http://snippets.bentasker.i2p/posts/python/sort-list-as-if-it-were-numbers.html
From https://arcpy.wordpress.com/2012/05/11/sorting-alphanumeric-strings-in-python/ and http://stackoverflow.com/questions/2669059/how-to-sort-alpha-numeric-set-in-python """ convert = lambda text : int ( text ) if text . isdigit () else text alphanum_key = lambda key : [ convert ( c ) for c in re . split ( '([0-9]+)' , key )] return sorted ( l , key = alphanum_key ) Usage Example a = [ '1a' , '12a' , '21c' , '3b' , '4a' , '5a' ] print sorted ( a ) # ['12a', '1a', '21c', '3b', '4a', '5a']...