>> 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
> 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
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
> 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'
"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
> 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
>
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