I am iterating a bunch of files like so:
for file in glob('./*.dat'):
print file
And the output is always the following:
./SAN0.dat
./SAN4.dat
./SAN1.dat
./SAN2.dat
./SAN3.dat
./SAN5.dat
./SAN6.dat
./SAN7.dat
How can I iterate them in order of their name, (meaning SAN1.dat would be second, for example)?
Thanks!
1 Answer