i would like to be able to execute an external python file that must have access to indigo methods i.e. access to the calling plugin python code.
when I spawn a external shell with
subprocess.Popen( "/usr/bin/python2.6 ‘“+pathToPyFile/pythonfile.py ", shell=True……)
it is an independent process that does not know anything of indigo or the calling plugin.
Here is what I like to accomplish:
start an action like:
plug = indigo.server.getPlugin("com.karlwachs.INDIGOplotD")
if not plug.isEnabled(): return
plug.executeAction("showDeviceStates" , props ={"deviceOrVariable": ‘abcdefxyz’})
where the command etc are supplied by the external python code..
An alternative would be to create an action python script and execute the action.
BUT in the current INDIGO version creating an action is not supported from python.
Just a thought... could I use eval() to "evaluate" the code?
thx
Karl