I was trying to write an image-to-PDF converter and I wrote one using the help of this answer: https://stackoverflow.com/a/45990883/13875145
I used this code:
import img2pdf
import glob
with open("name.pdf","wb") as f:
f.write(img2pdf.convert(glob.glob("/path/to/*.jpg")))
This program sorts the images on the basis of "name", but I would like to sort the images on the basis of "date modified ascending"
Thanks for the help in advance