Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from PyPDF2 import PdfFileMerger
- x = [a for a in os.listdir() if a.endswith(".pdf")]
- x.sort()
- merger = PdfFileMerger()
- for pdf in x:
- merger.append(open(pdf, 'rb'))
- name = x[-1]
- from pathlib import Path
- name = Path(name).resolve().stem
- with open(name + '까지.pdf', "wb") as fout:
- merger.write(fout)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement