Posts: 25
Joined: Oct 2013
Reputation:
0
2013-11-29, 04:17
(This post was last modified: 2013-11-30, 02:10 by nickthemagicman.)
Guys,
I really need to execute an external script from inside an addon.
Using the subprocess module gives me the error:
OSError: [Errno 10] No child processes]
Using os.system gives me the error:
Nov 28 20:10:58 nicks-MacBook-Pro [0x0-0x1be1be].com.teamxbmc.xbmc[1989]: ImportError: No module named site
I will be grateful with the force of a 1000 suns if you help me execute an external script!!!!!
Thanks!!!
Nick
Posts: 25
Joined: Oct 2013
Reputation:
0
2013-11-29, 04:41
(This post was last modified: 2013-11-29, 04:41 by nickthemagicman.)
In the xbmc addon directory
xbmc.myaddon.test
|->myScript.py
|->testScript.py
my python scripts are simply:
myScript.py
import os
os.sys("python testScript.py)
testScript.py
print "testing testing"
-----------------------
The catch is that the testScript HAS to be run on the local machine OS python VIA the xbmc python. This is becuase of various operating system c bindings. (It's the leap motion controller I'm trying to get working from a single click in an addon.)
Basically I just need to run a script using the local machine python.
I will be eternally gratefull and will send you flowers and beer if you can help.
Posts: 1,088
Joined: Nov 2012
Reputation:
51
2013-11-29, 11:48
(This post was last modified: 2013-11-29, 11:48 by Karnagious.)
You mean os.system('python testScript.py') right?
Posts: 25
Joined: Oct 2013
Reputation:
0
2013-11-29, 12:12
(This post was last modified: 2013-11-29, 12:34 by nickthemagicman.)
Sorry yes!
Typed it wrong.
Thanks!
Posts: 25
Joined: Oct 2013
Reputation:
0
Here's something interesting.
Running an os.system("echo $PYTHONPATH") inside xbmc says my python path is:
/Applications/XBMC.app/Contents/Frameworks/
Running it from inside of command line is
/Users/nick/Environment/pythonpath
So even when I make a system call it's not calling my local machine system python apparently.
Posts: 25
Joined: Oct 2013
Reputation:
0
HEEEEELLLLLP MEEHHHHHH please?!
Posts: 1,109
Joined: Feb 2011
Reputation:
39
Can you paste your actual full script codes (inside [ code ] tags please).