would i be able to list the contents returned from ls by using this code:
Code:
xbmc.executebuiltin("XBMC.RunScript(ls,$HOME)")is there a way to show the contents returned from ls by using os.system() within xbmc ?
thanks,
schneidz
Fan Posts: 389 Joined: Jun 2009 Reputation: 0 |
2009-07-23 07:09
Post: #1
hi, is it possible to run commands from within xbmc using a script.
would i be able to list the contents returned from ls by using this code: Code: xbmc.executebuiltin("XBMC.RunScript(ls,$HOME)")is there a way to show the contents returned from ls by using os.system() within xbmc ? thanks, |
| find quote |
althekiller
Team-XBMC Developer Joined: May 2004 Reputation: 12 |
2009-07-23 07:12
Post: #2
You want os.popen().
Howto post your problem in a useful manner. #xbmc-linux on FreeNode XBMC online-manual, FAQ, search, forum rules, how to submit a bugreport. |
| find quote |
Temhil
Skilled Python Coder Joined: Apr 2008 Reputation: 1 Location: Canada |
Here a function we did for the Installer Passion-XBMC script in order to list the content of a directory:
Code: import osThis will work on every OS including linux ![]() _____________________________ Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only) ![]() |
| find quote |
Temhil
Skilled Python Coder Joined: Apr 2008 Reputation: 1 Location: Canada |
2009-07-23 18:43
Post: #4
As althekiller said, if you want to get the STDOUT from the execution of external commands. Rather than use os.system(), use os.popen(), like so:
Code: import os![]() _____________________________ Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only) ![]() |
| find quote |
schneidz
Fan Posts: 389 Joined: Jun 2009 Reputation: 0 |
2009-07-24 06:29
Post: #5
^ thanks, i guess what i was looking for was something like a hello world example
|
| find quote |