pip img2pdf
import osimport img2pdfwith open("output.pdf", "wb") as f: f.write(img2pdf.convert([i for i in os.listdir('.') if i.endswith(".jpg")]))
Sandeep Bind
import osimport img2pdfwith open("output.pdf", "wb") as f: f.write(img2pdf.convert([i for i in os.listdir('.') if i.endswith(".jpg")]))