2012-11-28, 19:48
I am trying to make a script that uses external program to check the status of the system(mythshutdow --status to check the status of mythbackend). However I am not able to get the return value from the program when I run it as a addon, but if I run the same pease of code outside of xbmc then it works.
For example if I run this pease of code on command prompt.
I get the right output
But when I run the same pease of code inside xbmc python addon, the retValue is 0. So how can I get the return value of the program?
For example if I run this pease of code on command prompt.
Code:
import subprocess
retVal = subprocess.call("exit 2", shell=True)
print retVal
Code:
python2 default.py
2
But when I run the same pease of code inside xbmc python addon, the retValue is 0. So how can I get the return value of the program?