os.listdir

Randy Heiland heiland at ncsa.uiuc.edu
Tue Oct 30 12:43:34 EST 2001


I get this:

>>> for file in os.listdir('mydir'):
...   print file
...
f100.dat
f1.dat
f2.dat

but would like this:
f1.dat
f2.dat
f100.dat

What's the trick?

thanks,
Randy




More information about the Python-list mailing list