how would i go about getting a listing of the contents of a directory in python.
i want to get the names of the folders in the 'games' directory and store them in a list variable in python.
i've been reading the xbmc python doc, but have not figured this out yet. i also checked the python doc in the xbmc cvs, so i know there is no class already in the xbmc python libs to do this.
but there must be a method to get file and directory names with python!
Directory List
b01
Senior Member Posts: 117 Joined: Nov 2003 Reputation: 0 Location: Southfield, MI |
2004-04-15 19:34
Post: #1
reading must be magical or something, it's how i find all da anwsers! ------ Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300 |
| find quote |
alx5962
Senior Member Posts: 174 Joined: Jan 2004 Reputation: 0 Location: Lille, FRANCE |
2004-04-15 21:07
Post: #2
the os library builtin python will do that
|
| find quote |
b01
Senior Member Posts: 117 Joined: Nov 2003 Reputation: 0 Location: Southfield, MI |
2004-04-16 05:18
Post: #3
thanks alot, i now know how to retrieve list from directories with:
os.listdir(path) i took screenshots, but i cant post them just yet. reading must be magical or something, it's how i find all da anwsers! ------ Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300 |
| find quote |
b01
Senior Member Posts: 117 Joined: Nov 2003 Reputation: 0 Location: Southfield, MI |
2004-04-17 01:54
Post: #4
im trying to use the get dvd state function in the xbmc lib, like so:
Quote:if xmbc.getdvdstate() == -16: but i get the attributerror: 'module' object has no attribute ' getdvdstate' i know i saw this in the xbmc python doc, but how do i get the state of the dvd rom drive? reading must be magical or something, it's how i find all da anwsers! ------ Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300 |
| find quote |
xsintill
Member Posts: 50 Joined: Dec 2003 Reputation: 0 |
2004-04-17 10:07
Post: #5
do you have cvs build 13-04-2004 or later?
i see a mixup in your module name.... xmbc should be xbmc... |
| find quote |
b01
Senior Member Posts: 117 Joined: Nov 2003 Reputation: 0 Location: Southfield, MI |
2004-04-18 02:08
Post: #6
i posted this late last night so that was a typo, it is correct in the script.
i do not have xbmc 13-04-2004 build. i currently do not have .net installed on my pc, becuase i'm waiting to get a bigger hdd (only got a 20gb right now). so i have no way to complie the cvs. ok, i went to the cvs and dowloaded the makedoc.py and ran it on my xbmc and getdvdstatus is not in the build i have. so i have to get the latest build if i want to use that function. btw darkie i luv dat makedoc.py, it really helps. the makedoc script combined with alx5962's examples make learning python for xbmc simple. reading must be magical or something, it's how i find all da anwsers! ------ Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300 |
| find quote |
alx5962
Senior Member Posts: 174 Joined: Jan 2004 Reputation: 0 Location: Lille, FRANCE |
2004-04-18 11:48
Post: #7
darkie and i added getdvdstatus only few days ago so there's no cvs compile yet available including it.
so wait for a newer xbmc cvs build. |
| find quote |
carlosp_uk
Junior Member Posts: 47 Joined: Apr 2004 Reputation: 0 |
2004-04-19 15:17
Post: #8
i'm also waiting for a new anonymous cvs build so i can use the latest python methods - can anyone who knows the right people please do some nudging?
|
| find quote |
alx5962
Senior Member Posts: 174 Joined: Jan 2004 Reputation: 0 Location: Lille, FRANCE |
2004-04-19 20:17
Post: #9
the latest official release doesn't include our latest methods...
weird! |
| find quote |
alvette78
Junior Member Posts: 1 Joined: Jun 2004 Reputation: 0 |
2004-06-05 15:29
Post: #10
(b01 @ april 16 2004,04:18 Wrote:thanks alot, i now know how to retrieve list from directories with:could you post the script you created |
| find quote |

Search
Help