2005-09-18, 02:19
is it possible do open the drive-tray with an phyton command. my dvd-drivbe has a bug and so i want to close its tray after startup xbmc autmatically.
greetings
tetzlav
greetings
tetzlav
Quote:import xbmc
from time import sleep
sleep(2) # suspend script for specified amount of time (secs) to wait for xbmc ready (maybe it is not essential... do not know)
if xbmc.getdvdstate==xbmc.tray_open:
xbmc.executebuiltin(xbmc.ejecttray())
Quote:#! pythonbut this does nothing too. the pythonscripts had do be in cr or lf character set?
import xbmc
#from time import sleep
#sleep(2) # suspend script for specified amount of time (secs) to wait for xbmc ready (maybe it is not essential... do not know)
#if xbmc.getdvdstate==xbmc.tray_open:
xbmc.executebuiltin(xbmc.ejecttray())
Quote:#!pythonnow the script works fine!
import xbmc
xbmc.executebuiltin('xbmc.ejecttray()')