os.path.walk

Tony Meyer t-meyer at ihug.co.nz
Wed Apr 13 00:07:47 EDT 2005


> If I have os.path.walk(name, processDirectory, None) and 
> processDirectory needs three arguments how can I ass them 
> because walk only takes 3?

Assuming that processDirectory is a function of yours that returns a bool,
then you'd do something like:

  os.path.walk(name, processDirectory(a,b,c))

Where a, b, and c are the arguments that processDirectory requires.  (You
can add the None parameter to the os.path.walk call, but it won't change
anything, since it's the default).

=Tony.Meyer




More information about the Python-list mailing list