第一步:安装包
pip install python-office
第二步:写代码,运行
# 安装库:pip install python-office
import office
# 单页转图片
office.ppt.ppt2img(input_path="input.pptx", output_path="output", merge=False)
第三步:如果你是Office,现在已经搞定了。但我是WPS,会报错:
PS D:\PPT自动生成_强化学习> & C:/Python313/python.exe d:/PPT自动生成_强化学习/extract_ppt_images_new.py
INFO: Imported existing <module 'comtypes.gen' from 'C:\\Python313\\Lib\\site-packages\\comtypes\\gen\\__init__.py'>
INFO: Using writeable comtypes cache directory: 'C:\Python313\Lib\site-packages\comtypes\gen&#