Sharing python variable between action groups

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Thu Mar 14, 2013 10:30 pm
HA1 offline
Posts: 71
Joined: Mar 15, 2012

Sharing python variable between action groups

If I have two action groups each with an embedded python script, is there any simple way to share a python variable between them? The variable wouldn't change, it's just a list I want them both to have access to. If not, other way to share some list?

Posted on
Fri Mar 15, 2013 9:01 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Sharing python variable between action groups

Python has a built-in way to share scripts (and data in scripts) that is roughly parallel to AppleScript attachments. We discuss it in the Scripting Tutorial.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Mar 15, 2013 9:24 pm
HA1 offline
Posts: 71
Joined: Mar 15, 2012

Re: Sharing python variable between action groups

Thanks for the reply. The problem is, I keep getting the error: "embedded script: no module named indigoInclude"

I have a script in /Library/Python/2.5/site-packages
as well as /Library/Python/2.7/site-packages

I called it "indigoInclude.py" and I tried the name "indigoInclude" and no matter what I do it won't load and gives me this error. If I launch a standard python script from command line, it finds the file by doing "import indigoInclude" - any idea why Indigo's not finding it?

Posted on
Sat Mar 16, 2013 10:22 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Sharing python variable between action groups

When you add/remove something from the site-packages, much like when you add something to the Attachments folder, you need to tell Indigo that something changed. Select "Plugins->Reload Libraries and Attachments" and Indigo will restart both interpreters (thus causing the additions to become available).

BTW, the 2.5 directory is the right one - we use Python 2.5 for the IOM.

[EDIT] - I've updated the Scripting Tutorial with this information - it was an oversight that it wasn't there before.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Mar 16, 2013 9:30 pm
HA1 offline
Posts: 71
Joined: Mar 15, 2012

Re: Sharing python variable between action groups

Thanks, that worked!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests