2016-08-04, 17:06
Hello,
I have to problems, according to use python scripts.
1.
I tried to call a python script via another. The code looks like this:
when calling the script via console with sudo python test.py it gives me this error:
How to fix this?
2.
The second script should be called by the Yatse-Remote-App for Android. The App can call all of the Kodi functions (http://kodi.wiki/view/List_of_built-in_functions)
The on.py looks like this:
I added the exit() after I tried to call it with the Yatse-Remote-App for Android, and got the error that the script wont terminate.
But the main Problem ist, when calling this script via console it works flawless. But it doesn't work when called by the App.
I just get this warnings in the log file
Thank you in advande!
I have to problems, according to use python scripts.
1.
I tried to call a python script via another. The code looks like this:
Code:
import xbmc
xbmc.executebuiltin('XBMC.RunScript(special://home/scripts/on.py')
when calling the script via console with sudo python test.py it gives me this error:
Code:
osmc@PI:~/.kodi/scripts$ sudo python test.py
Traceback (most recent call last):
File "test.py", line 1, in <module>
import xbmc
ImportError: No module named xbmc
How to fix this?
2.
The second script should be called by the Yatse-Remote-App for Android. The App can call all of the Kodi functions (http://kodi.wiki/view/List_of_built-in_functions)
The on.py looks like this:
Code:
import wiringpi as wiringpi
wiringpi.wiringPiSetupPhys()
wiringpi.pinMode(3, 1) # sets physical pin 3 to output
wiringpi.digitalWrite(3, 0)
exit()
But the main Problem ist, when calling this script via console it works flawless. But it doesn't work when called by the App.
I just get this warnings in the log file
Code:
17:04:32 2249.907959 T:1794118640 WARNING: CPythonInvoker(8): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.
17:04:32 2250.401611 T:1829245936 WARNING: CPythonInvoker(0, /usr/share/kodi/addons/script.module.osmcsetting.updates/service.py): the python script "/usr/share/kodi/addons/script.module.osmcsetting.updates/service.py" has left several classes in memory that we couldn't clean up. The classes include: N14PythonBindings31XBMCAddon_xbmc_Monitor_DirectorE,N9XBMCAddon7xbmcgui12ControlImageE,N9XBMCAddon7xbmcgui6WindowE
Thank you in advande!