sort by file/directory

Mike Zupan mzupan at meso.com
Wed Sep 10 14:42:24 EDT 2003


I have a list that includes files and directories

ie: list = ['file', 'file2', 'dir1','file3','dir2' ]

I want to sort it so it looks like this

['dir1', 'dir2', 'file1','file2','file3' ]


I'm just wondering if there is an easy way to do this

Thanks
Mike




More information about the Python-list mailing list