在Python中复制PowerPoint(PPT)文件并创建一个副本
from pptx import Presentation
def copy_presentation(source_path, dest_path):
# 加载源演示文稿
prs = Presentation(source_path)
# 保存为新的文件
prs.save(dest_path)
# 指定源文件和目标文件的路径
source_file = 'D:\\desktop\\测试.pptx'
destination_file = 'D:\\desktop\\测试222222.pptx'
# 调用函数进行复制
copy_presentation(source_file, destination_file)