Find and Delete all files with .xxx extension

Mark McEahern mark at mceahern.com
Sun Dec 14 16:49:41 CET 2003


On Sun, 2003-12-14 at 09:06, hokiegal99 wrote:
> > I would say:  if fname.lower().endswith( '.mp3' ):
> 
> Why the '.lower()' part? Wouldn't if fname.endswith('.mp3'): work just
> as well, or am I missing something here?

Because the filename might be WHATEVER.MP3 and endswith, presumably, is
case-sensitive.

Cheers,

// m






More information about the Python-list mailing list