[Tutor] scratching my head

Cameron Simpson cs at zip.com.au
Mon Aug 3 10:22:32 CEST 2015

On 03Aug2015 08:12, Laura Creighton <lac at 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.

Cameron Simpson <cs at zip.com.au>

More information about the Tutor mailing list