On 03Aug2015 08:12, Laura Creighton <l...@openend.se> wrote:
I think people are giving you sub-optimal advice.
Python has a module in the standard library for doing exactly what
you want to do -- match files with certain extensions.
See: https://docs.python.org/2/library/fnmatch.html
It's unix style file matching, but I am fairly certain this works
on windows also. I don't have a windows machine to test and make sure.
That depends. This is the tutor list; we're helping Clayton debug his code as
an aid to learning. While it's good to know about the facilities in the
standard library, pointing him directly at fnmatch (which I'd entirely
forgotten) is the "give a man a fish" approach to help; a magic black box to do
the job for him.
Besides, I'm not sure fnmatch is much better for his task than the more direct
methods being discussed.
Cheers,
Cameron Simpson <c...@zip.com.au>
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor