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
Here is a quick hack: import os import os.path givenDir = "/" listing = os.listdir(givenDir) for item in listing: joinPath = os.path.join(givenDir, item) normPath = os.path.normpath(joinPath) if os.path.isdir(normPath): print normPath -- http://mail.python.org/mailman/listinfo/python-list