mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-20 01:34:55 +08:00
工具
This commit is contained in:
parent
a9ac2cf223
commit
9effaf05b1
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@
|
|||||||
*.zip
|
*.zip
|
||||||
*.pyc
|
*.pyc
|
||||||
*.vscode
|
*.vscode
|
||||||
|
*.pdf
|
||||||
package.json
|
package.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
venv/
|
venv/
|
||||||
|
0
工具/合并pdf/__init__.py
Normal file
0
工具/合并pdf/__init__.py
Normal file
0
工具/合并pdf/main.py
Normal file
0
工具/合并pdf/main.py
Normal file
13
工具/合并pdf/合并pdf.py
Normal file
13
工具/合并pdf/合并pdf.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import os
|
||||||
|
from PyPDF2 import PdfMerger
|
||||||
|
|
||||||
|
target_path = 'docs'
|
||||||
|
pdf_lst = [f for f in os.listdir(target_path) if f.endswith('.pdf')]
|
||||||
|
print(pdf_lst)
|
||||||
|
pdf_lst = [os.path.join(target_path, filename) for filename in pdf_lst]
|
||||||
|
|
||||||
|
file_merger = PdfMerger()
|
||||||
|
for pdf in pdf_lst:
|
||||||
|
file_merger.append(pdf) # 合并pdf文件
|
||||||
|
|
||||||
|
file_merger.write("docs/终稿-艾映锋-电商数据采集与数据分析-论文.pdf")
|
Loading…
x
Reference in New Issue
Block a user