regular expressions eliminating filenames of type foo.thumbnail.jpg

Justin Ezequiel justin.mailinglists at gmail.com
Mon Jun 25 01:00:45 EDT 2007


Why not ditch regular expressions altogether for this problem?

[ p for p in os.listdir(dir)
  if os.path.isfile(os.path.join(dir,p))
  and p.lower().find('.thumbnail.')==-1 ]




More information about the Python-list mailing list