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