On Fri, Jan 2, 2009 at 6:44 PM, bob gailer <bgai...@gmail.com> wrote: > Since file is a built-in function it is a good idea to not use it as a > variable name.
Oooh! I did not know that ... thanks ... went through and changed them all. > for fn in files: > base, ext = os.path.splitext(fn) > if ext in ['*.flac','*.mp3','*.m4a']: > #do some stuff if the someFile matches one of the items in the list I caught the * bit - I must be learning! One thought though ... because fnmatch ignores case I could get away with: .FLAC, .flac, .FLac, or any other such foolishness for file extensions ... Using the above approach, however, matches by case ... so, I think, to be safe, I would have to list each iteration of the case in the list ... is there a way to account for that ? Thanks again - Damon _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor