Re: os.chdir doesn't accept variables sometimes

2006-06-02 Thread DataSmash
A simple way to get all the files throughout the directory sturcture... You may have to rewrite the "CONVERTING" part. import os, glob for root, dirs, files in os.walk(os.getcwd()): for file in files: if file.endswith(".mp3"): print "File: " + os.path.abspath(os.path.join(

Re: os.chdir doesn't accept variables sometimes

2006-06-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > #!/usr/bin/python > > from os import * > > chdir("/home/chainlynx/Desktop/Music") > for artist in listdir(getcwd()): > print "===ARTIST: "+artist > chdir(artist) > for album in listdir(getcw

Re: os.chdir doesn't accept variables sometimes

2006-06-02 Thread BartlebyScrivener
>> for album in listdir(getcwd()): doesn't listdir give you subdirectories AND files? So, then if you try to: chdir(album) If album is a file, it chokes? Just a guess. I'm on Windows, not Linux. rd -- http://mail.python.org/mailman/listinfo/python-list