Drive eject/load over python command - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Drive eject/load over python command (/showthread.php?tid=15002) |
- tetzlav - 2005-09-18 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 - solexalex - 2005-09-18 try this. not tested ... so just tell me what it does : -wait 2 seconds to be sure... just in case -test if cd tray is open - if so, launch a command to close it the test is important as it is the same command to open or close the tray hope it works for you ! just copy the code below and past it inside a simple text file ; name it as you want .py (i.e autoclosecdtray.py) ; upload it in your xbmc script folder if you want to launch it automatically at startup, name it autorun.py (or autoexec.py don't remember ) and place it exactly in your q:\script directory Quote:import xbmc - tetzlav - 2005-09-18 thank you for the answer, but the xbmc.executebuiltin(xbmc.ejecttray())-command doesnt work for me. i've tried this too (without sleep and tray-open-check) Quote:#! pythonbut this does nothing too. the pythonscripts had do be in cr or lf character set? the eject/load-button in shutdown-submenu works fine. further ideas!? ***edit*** i found the fault: you have to encase the executebuiltin in two ' (apostrophe) like that Quote:#!pythonnow the script works fine! thanks! ***/edit*** greetings tetzlav - solexalex - 2005-09-18 ok sorry for this missing ! did you try my first script with single quotes ? does it work ? |