我试图通过 kodi 运行一个 python 脚本,它打开一个到我的远程 Raspberry Pi 的 SSH 连接并运行一个 .sh 脚本。然而,Kodi 似乎无法很好地解决路径。
我从 termux 运行了同样的 python 脚本,它运行良好。不确定我是否必须使用 xbmc.translatepath。那里有任何科迪传奇知道我做错了什么吗?
#!/usr/bin/python2
import subprocess
subprocess.call('ssh pi@192.168.1.14 -p 22 -i /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.hyperion/.ssh/id_rsa bash "/home/pi/hyperion_on.sh"', shell=True)
请参阅下面的错误。
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script
returned the following error<--- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.OSError'>
Error Contents: [Errno 2] No such file or directory
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.hyperion/hyperion_on.py", line 17, in <module>
subprocess.call('ssh pi@192.168.1.14 -p 22 -i /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.hyperion/.ssh/id_rsa bash "/home/pi/hyperion_on.sh"', shell=True)
File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux- androideabi-android-21/lib/python2.7/subprocess.py", line 523, in call
File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux- androideabi-android-21/lib/python2.7/subprocess.py", line 711, in __init__
File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux- androideabi-android-21/lib/python2.7/subprocess.py", line 1343, in _execute_child
OSError: [Errno 2] No such file or directory
-->End of Python script error report<--