I'm creating pdf file from images but having problem with sorting the jpg files in numeric order I have 20 files from 1.jpg to 20.jpg I'm using below code to sort all files in order
import os
sorted(os.listdir('path/to/jpg/files'))
but it will print 1.jpg, 11.jpg, 12.jpg and so on.
Any ideas?