我尝试启用自动导入图片,以防止每次手动添加 100 张图片。我似乎无法访问图片的占位符并用新图片替换它们。一些正确方向的指南会很有帮助。
我开始的代码:
import pptx
import pptx.util
from pptx import Presentation
prs = Presentation('prepare_2.pptx')
picture_runs = []
for slide in prs.slides:
for shape in slide.shapes:
if shape.shape_type == 13:
slide.get.image('tree.jpg')
>Picture_runs.append((shape.name,shape.shape_type,shape.id,shape.image))
找到我获得的信息:http: //python-pptx.readthedocs.io/en/latest/user/quickstart.html