我正在尝试将多个PDF合并到名为“ Rate-Rule附件”的文件夹中
并使用以下功能将合并的文件输出到“ Merged_PDF”文件夹中
import glob
from PyPDF2 import PdfFileMerger
import os
input_paths=os.walk('Rate-Rule Attachments')
output_path=os.walk('Merged_PDF')
def merger(output_path, input_paths):
pdf_merger = PdfFileMerger()
file_handles = []
for path in input_paths:
pdf_merger.append(path)
with open(output_path, 'wb') as fileobj:
pdf_merger.write(fileobj)
if __name__ == '__main__':
paths = glob.glob('Rate-Rule Attachments\*')
merger('VA.pdf', paths)
但是,当我运行该函数时,是否在对象标题中找到了Superflous Whitespace?
这是命名方案的问题吗?还是pdf本身?