sarkas.utilities.io.num_sort#

sarkas.utilities.io.num_sort(text)[source]#

Sort strings with numbers inside.

Parameters

text (str) – Text to be split into str and int

Returns

list – List containing text and integers

Notes

Function copied from https://stackoverflow.com/questions/5967500/how-to-correctly-sort-a-string-with-a-number-inside. Originally from http://nedbatchelder.com/blog/200712/human_sorting.html (See Toothy’s implementation in the comments)