file find module
Andrew Dalke
dalke at dalkescientific.com
Thu Sep 27 13:27:52 EDT 2001
mallum wrote:
>Does a module exist ( pref in standard dist ) that will recursively
>search directorys for filenames matching a certain pattern ( like
>Perl's File::Find ) - or will I have to write something for scratch ?
There's the 'find' module, but I don't see any documentation
for it - even in the current development docs. It's in my
Python 1.5.2 distribution.
filename_list = find.find(pattern, [base directory])
where the "pattern" is a pattern string interpreted by fnmatch.
Or, you can write your own based on the os.path.walk function.
Andrew
dalke at dalkescientific.com
More information about the Python-list
mailing list