This a list that i sorted:
>> list1.sorted()
>> list1
['tmp-0.gif', 'tmp-1.gif', 'tmp-10.gif', 'tmp-11.gif', 'tmp-12.gif', 'tmp-13.gif', 'tmp-14.gif', 'tmp-15.gif', 'tmp-16.gif', 'tmp-17.gif', 'tmp-18.gif', 'tmp-19.gif', 'tmp-2.gif', 'tmp-20.gif', 'tmp-21.gif', 'tmp-22.gif', 'tmp-23.gif', 'tmp-24.gif', 'tmp-25.gif', 'tmp-26.gif', 'tmp-27.gif', 'tmp-28.gif', 'tmp-29.gif', 'tmp-3.gif', 'tmp-30.gif', 'tmp-31.gif', 'tmp-4.gif', 'tmp-5.gif', 'tmp-6.gif', 'tmp-7.gif', 'tmp-8.gif', 'tmp-9.gif']
I need this:
['tmp-0.gif', 'tmp-1.gif', 'tmp-2.gif' ... 'tmp-31.gif']
not:
['tmp-0.gif', 'tmp-1.gif', 'tmp-10.gif'...]
Does Python have a built in function for string natural sort? solve the problem, but i will need to download methods... and the answer below solved the problem using only basic python