Re: Random Problems

2008-08-14 Thread Cousin Stanley
>> Well the othe day I was making a program to make a list >> of all the songs in certian directorys but I got a problem, >> only one of the directorys was added to the list. >> Heres my code: >> >> import random >> import os >> import glob >> >> songs = glob.glob('C:\Documents and Settings\Adm

Re: Random Problems

2008-08-13 Thread Cousin Stanley
> list_songs = glob.glob( "'%s/%s'" % ( base_dir , this_dir ) Missed a closing paren list_songs = glob.glob( "'%s/%s'" % ( base_dir , this_dir ) ) Still NOT Tested -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailman/listinfo/python-list

RE: Random Problems

2008-08-13 Thread Edwin . Madari
gt; good luck. Edwin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cousin Stanley Sent: Wednesday, August 13, 2008 10:19 PM To: python-list@python.org Subject: Re: Random Problems > Well the othe day I was making a program to make a list > of al

Re: Random Problems

2008-08-13 Thread Cousin Stanley
> Well the othe day I was making a program to make a list > of all the songs in certian directorys but I got a problem, > only one of the directorys was added to the list. > > Here's some code that illustrates yours import glob songs = glob.glob( '/path/to/somewhere/*.mp3'

Re: Random Problems

2008-08-12 Thread Hrvoje Niksic
"Lanny" <[EMAIL PROTECTED]> writes: > Well the othe day I was making a program to make a list of all the > songs in certian directorys but I got a problem, only one of the > directorys was added to the list. Heres my code: > > import random > import os > import glob If you need recursive traversa

Re: Random Problems

2008-08-12 Thread Lanny
> 1) You need to either use raw string for your pathnames or use forward > slashes. > This is because backslash is an escape character to Python and if you get > any legal escaped sequence (like \n, \t, etc) it won't work as expected. > > songs = glob.glob(r'C:\Documents and Settings\Admin\My >

Re: Random Problems

2008-08-12 Thread Larry Bates
Lanny wrote: Well the othe day I was making a program to make a list of all the songs in certian directorys but I got a problem, only one of the directorys was added to the list. Heres my code: import random import os import glob songs = glob.glob('C:\Documents and Settings\Admin\My Document