# 安装pypdf2,命令为 pip install pypdf2
from PyPDF2 import PdfReader, PdfWriter
pdf_reader = PdfReader('你的路径.pdf')
pdf_writer = PdfWriter()
length = len(pdf_reader.pages)
for page in range(length-1, -1, -1):
pdf_writer.add_page(pdf_reader.pages[page])
with open('reordered.pdf', 'wb') as f:
pdf_writer.write(f)