Soren wrote: > Hi, > > I'd like to read the filenames in a directory, but not the > subdirectories, os.listdir() gives me everything... how do I separate > the directory names from the filenames? Is there another way of doing > this? > > Thanks!
import os base, files, dirs = iter(os.walk(dirname)).next() # now files is files and dirs is directories (and base == dirname) -- http://mail.python.org/mailman/listinfo/python-list