I’m running a python script at startup. All it does is it opens a .bat file. It works fine by double clicking it, but when I run it from Kodi I get
Code:
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.WindowsError'>
Error Contents: [Error 2] The system cannot find the file specified
Traceback (most recent call last):
File "C:\Users\firewater\AppData\Roaming\Kodi\userdata\series.py", line 5, in <module>
p = Popen("Series.bat", cwd=r"C:\Users\firewater\AppData\Roaming\Kodi\userdata")
File "C:\Program Files (x86)\Kodi\system\python\Lib\subprocess.py", line 710, in __init__
errread, errwrite)
File "C:\Program Files (x86)\Kodi\system\python\Lib\subprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
-->End of Python script error report<--
This is the script:
Code:
import time
import os
from subprocess import Popen
time.sleep(2.5)
p = Popen("Series.bat", cwd=r"C:\Users\firewater\AppData\Roaming\Kodi\userdata")
stdout, stderr = p.communicate()
I’m guessing Kodi’s subprocess.py is interfering with the script? I don’t write in Python, so I really don’t know much about this – I more or less copypasted this from Google.
If anyone knows another way to call the .bat, that’s alright too, I just want it opened at the startup of Kodi.