os.walk trouble

BartlebyScrivener rpdooling at gmail.com
Thu Jun 1 20:21:28 CEST 2006

> As my first Python script, I am trying to make a program that recurses
> a directory searching for files whose names match a pattern. I have a
> basic idea of what the regexp would look like

You probably don't need regexp for this, just use the fnmatch module


There's a great recipe in the Python Cookbook 2ed for just what you're
trying to do. In fact, I believe there's a recipe in there for just
about anything anybody (at the beginner or intermediate level) wants to
do with Python.

The recipe, with some other unrelated problems:


Amazon Python Cookbook link:


good luck


More information about the Python-list mailing list