Traversing A Directory For Files

Greg Green gregory.p.green at boeing.com
Mon Jan 22 14:40:53 EST 2001


Ben wrote:
> 
> Hi,
> 
> I am looking for examples of a recusive Python algorithm to traverse a
> directory and all subdirectories for files and return them to a list for
> further processing.
> 
> I have something written already ... but it doesn't appear to be that
> eloquant
> 
> Thanks In Advance

Try os.walk in the os module distributed with python.

http://www.python.org/doc/current/lib/module-os.path.html

-- 

Greg Green
Advanced Design Systems
Math & Computing Technology
Boeing
(425) 865-2790



More information about the Python-list mailing list