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
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
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?
- jay (support)
- Site Admin
- Posts: 19232
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
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.
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?
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?
- jay (support)
- Site Admin
- Posts: 19232
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
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.
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.
Re: Sharing python variable between action groups
Thanks, that worked!