Scripting question about a few things
#1
ok guys, i'm totally new to python on xbmc so there is probably a simple answer to this.

i'm trying to execute an xbe file from a python script. i've searched all the usual xbmc places for a script which does this already but there doesn't seem to be one. there is this in the xbmc library:

xbmc.executescript = []
executescript(string) -- execute a python script. example: - executescript('q:\scripts\update.py')

which executes a python script but i can't find something that will execute an actual xbe file.

also, i'm trying to write a script which will switch the view to the weather. none of the classes in either the xbcm library or the xbmcgui library seem to be able to do this.

am i missing something obvious?
Reply
#2
you're probably out of luck, when it comes to executing an xbe. i just read yesterday one of the devs posted that it can't be done, to the best of his knowledge. now, that wasn't darkie (darkie's the only one developing the python stuff), so it's not necessarily true, but it sounded true.

anyway, there's not currently a python command that will do it, but you should try using "os.startfile(path)" with the name of the xbe. that's how you'd execute a .exe on a windows machine, anyway, but the xbmc port of the os module seems sketchy at best.

to view the weather, read darkie's last post here. i don't know for sure that it will work, but if you can find the window id for weather, i imagine the same trick will work.

alexpoet
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#3
thanks for the quick reply. the code to display the weather (and other windows) was really easy.

Quote:import xbmc, xbmcgui

myweather=xbmcgui.window(12600)
myweather.show()

job done Smile

just scan through the key.h file which is here for more codes. i've written scripts which do all the other major pages and it seems to work fine.

just need to be able to 'execute' the refresh button once the page is displayed, or to access the smb button for example and i'm set Smile

as for executing an xbe file i'll take a look into that next.
Reply
#4
np. i just saw darkie's post yesterday and thought to myself, "well that's some useful info!" so i bookmarked. little did i know it would come in handy the very next day. :-)

i'm glad you got it working. let me know what you find about executing the file. if it doesn't work, maybe we can pester the devs into making something that does, because that seems like some very important functionality.
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#5
well it seems you're correct. there's no current way of executing an actual xbe file. shame really as that could be really useful.
Reply
#6
well, it does seem to be possible to run an xbe file from the dialogsubmenu.xml file. i wonder if its possible to call menu items on that menu from a python script? you could have your xbes referenced in hidden menu options and you'd be done.

bit clunky but as a work around it might just work.
Reply
#7
executing scripts is not possible from within python

as for feature requests to python. i get alot off them but most of the time i forget about them Blush
best would be to add a feature request at sourceforge.net in the category 'python code and/or scripts'. there is only one in there atm Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
cheers darkie, i'll do that  :d

edit: click here for the request Cool
Reply
#9
oh, wow. i didn't know about that option. darkie, it's gonna get crowded....
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#10
he he he !
i will use it as well if english is not too hard for me Wink
be ready darkie Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Scripting question about a few things0