Last active
June 5, 2020 18:09
-
-
Save go4Mor4/a24f23930454500accf4a95379fe9a83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_pdf(PATH, nome_pdf): | |
images, list_images = [name for name in os.listdir(PATH) if name.endswith('.png')], [] | |
for i in images: | |
image = Image.open(PATH+i) | |
list_images.append(image) | |
list_images[0].save(rf'{PATH}{nome_pdf}', save_all=True, append_images=list_images[1:]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment