Getting all the *files* from a directory -- A better way??

nanotech at nanotech at
Wed Mar 28 00:36:24 CEST 2001


Here is how I get all the files from a directory:

  files=filter(os.path.isfile,["%s/%s"%(dir,f) for f in os.listdir

Is this *REALLY* the Pythonic way to do this? (OR, why does
os.listdir return only file names, and not the path given

Quentin Crain

More information about the Python-list mailing list