[Tutor] sort list alphabetically

lmac lopoff at gmx.net
Wed Nov 23 18:55:24 CET 2005


Hallo,

i have a list with the dirs/files from the current path.
When i use sort() to sort the list alphabetically the list
is still unsorted. How to use ?

dirs_files = os.listdir(os.getcwd())
print dirs_files
dirs_files.sort()
print dirs_files

Thank you.


More information about the Tutor mailing list