[Tutor] Better way - fnmatch with list ? CORRECTION

Jervis Whitley jervisau at gmail.com
Sat Jan 3 01:16:50 CET 2009


On Sat, Jan 3, 2009 at 10:48 AM, bob gailer <bgailer at gmail.com> wrote:

> bob gailer wrote:
>>
>>
>> for fn in files:
>>   base, ext = os.path.splitext(fn)
>>   if ext in ['.flac','.mp3','.m4a']:   ## CORRECTION removed *
>>
>>
>
for fn in files:
  base, ext = os.path.splitext(fn)
  if ext.lower() in ['.flac', '.mp3', '.mp4']:

takes into account systems with case sensitive filenames.

cheers,

Jervis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090103/a9dfd54c/attachment-0001.htm>


More information about the Tutor mailing list