searching for files on Windows with Python

Dennis Benzinger Dennis.Benzinger at gmx.net
Thu Nov 17 08:59:32 EST 2005


Shane schrieb:
> I've been giving Google a good workout with no luck. I would like to be able to search a Windows filesystem for filenames, returning a list off absolute paths to the found files, something like:
> 
> def findFiles(filename, pathToSearch):
>      ...
>      ...
>      return foundFileNames
> 
> Is the os module where I should start?
> [...]

Yes, especially the os.walk() function should help you.

Bye,
Dennis



More information about the Python-list mailing list