files = ['PresserInc-1.jpg', 'PresserInc-1_10.jpg', 'PresserInc-1_11.jpg', 'PresserInc-10.jpg', 'PresserInc-2.jpg', 'PresserInc-3.jpg', 'PresserInc-4.jpg', 'PresserInc-5.jpg', 'PresserInc-6.jpg', 'PresserInc-11.jpg']
import re
def natural_sort(l):
convert = lambda text: int(text) if text.isdigit() else text.lower()
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
return sorted(l, key = alphanum_key)
print natural_sort(files)
ZmlsZXMgPSBbJ1ByZXNzZXJJbmMtMS5qcGcnLCAnUHJlc3NlckluYy0xXzEwLmpwZycsICdQcmVzc2VySW5jLTFfMTEuanBnJywgJ1ByZXNzZXJJbmMtMTAuanBnJywgJ1ByZXNzZXJJbmMtMi5qcGcnLCAnUHJlc3NlckluYy0zLmpwZycsICdQcmVzc2VySW5jLTQuanBnJywgJ1ByZXNzZXJJbmMtNS5qcGcnLCAnUHJlc3NlckluYy02LmpwZycsICdQcmVzc2VySW5jLTExLmpwZyddCgppbXBvcnQgcmUKCmRlZiBuYXR1cmFsX3NvcnQobCk6IAogICAgY29udmVydCA9IGxhbWJkYSB0ZXh0OiBpbnQodGV4dCkgaWYgdGV4dC5pc2RpZ2l0KCkgZWxzZSB0ZXh0Lmxvd2VyKCkgCiAgICBhbHBoYW51bV9rZXkgPSBsYW1iZGEga2V5OiBbIGNvbnZlcnQoYykgZm9yIGMgaW4gcmUuc3BsaXQoJyhbMC05XSspJywga2V5KSBdIAogICAgcmV0dXJuIHNvcnRlZChsLCBrZXkgPSBhbHBoYW51bV9rZXkpCgpwcmludCBuYXR1cmFsX3NvcnQoZmlsZXMp
['PresserInc-1.jpg', 'PresserInc-1_10.jpg', 'PresserInc-1_11.jpg', 'PresserInc-2.jpg', 'PresserInc-3.jpg', 'PresserInc-4.jpg', 'PresserInc-5.jpg', 'PresserInc-6.jpg', 'PresserInc-10.jpg', 'PresserInc-11.jpg']