It's a bit overkill, but consider using os.walk.

root, dirnames, filenames = os.walk(r"C:\").next()  # (in real code,
you'd want to catch exceptions here)
print dirnames

Florian Lindner wrote:
> Hello,
> how can I get all subdirectories of a given directories? os.listdir() gives
> me all entries and I've found no way to tell if an object is a file or a
> directory.
> 
> Thanks,
> 
> Florian

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

Reply via email to