On May 16, 10:12 am, Brian <[EMAIL PROTECTED]> wrote:
> 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.
>

Try reading the Python docs instead :-)
In general, anyone doing anything much with files and directories
should know what's in the os and os.path modules.
In particular, os.walk is probably what you are looking for.

HTH,
John

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to