On 2006-08-12 09:46:54 -0700, "KraftDiner" <[EMAIL PROTECTED]> said:

> Hi I need help writing a python script that traverses (recursivly) a
> directory and its sub directories and processes all files in the
> directory.

In addition to os.walk, I find Jason Orendorff's 'path' module very 
helpful and much easier to use. You can get at 
<http://www.jorendorff.com/articles/python/path/>. With it, for 
instance, processing all the C source files in a directory, 
recursively, would look like:

theDir = path('pathToDir')
for theFile in theDir.walkFiles('*.c'):
    # Do something

Best,
        David

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to