HELP:sorting list of outline numbers

Felix Collins felix at keyremovethisghost.com
Wed Aug 3 03:15:20 CEST 2005


Hi All,
does anyone know any cleaver tricks to sort a list of outline numbers.

An outline number is a number of the form...    1.2.3

they should be sorted in the following way...

1
1.1
1.2
1.12

python's alpha sort (by design) sorts them...

1
1.1
1.12
1.2

That's no good for me.
I'm planning on splitting the strings into multiple lists of ints and 
doing numerical sorts.

Thanks for any clever ideas that might make it easier.

Felix



More information about the Python-list mailing list