Get the filenames in a directory and its subdirectories

Gerhard Häring gh at ghaering.de
Sun Jun 29 16:35:24 EDT 2003


Psymaster wrote:
> That would be very handy for a small progrtam I've written. I've 
> browsed through the documentation for the standard modules but 
> there doesn't seem to be a way (please correct me if I'm wrong).

os.path.walk

> I know that it shouldn't be very hard to write a module myself 
> using listdir() and isdir() or stuff like that, 

Yep, this and a recursive function. BTDT. And many other people did this 
as well ;-)

> but I'm having problems.

Unless you describe which problems it's unlikely anybody can help ;-)

-- Gerhard





More information about the Python-list mailing list