Newbie Question: Getting a list of files

Brian desertlinux at netscape.net
Tue May 15 20:12:01 EDT 2007


Hello,

I am currently working on putting together a free, open source, 
anti-spyware program for the Mac (and eventually for other OS's too.) 
However, there's one thing that I am currently trying to figure out:

How do I, in Python, obtain a recursive list of files in a specified 
directory, including the subdirectories, etc?  For example, in the old 
MS-DOS days, we could specify at the command prompt "DIR /S" and this 
would provide a listing of all files, including those in subdirectories, 
no matter how far down the branch they were.  How can this be done with 
Python?

P.S. I have been searching Google, but haven't found the answer yet.

Any info appreciated!

Dusty
---



More information about the Python-list mailing list