"Damon Timm" <damont...@gmail.com> wrote in message news:262679b50901031327n23b2f754l62fe0cf98751c...@mail.gmail.com...
On Fri, Jan 2, 2009 at 7:16 PM, Jervis Whitley <jervi...@gmail.com> wrote:
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.

Thanks!  Will throw that in there.  I'm getting it ... bit by little bit.

fnmatch already takes into account systems with case-sensitive filenames:

help(fnmatch.fnmatch)
Help on function fnmatch in module fnmatch:

fnmatch(name, pat)
   Test whether FILENAME matches PATTERN.

   Patterns are Unix shell style:

   *       matches everything
   ?       matches any single character
   [seq]   matches any character in seq
   [!seq]  matches any char not in seq

   An initial period in FILENAME is not special.
   Both FILENAME and PATTERN are first case-normalized
   if the operating system requires it.
   If you don't want this, use fnmatchcase(FILENAME, PATTERN).

-Mark


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to