我希望您能自动导入图片,以避免每次手动添加数百张图片。但我似乎无法访问图片的占位符并用新图片替换它们。
如果您能指点一下正确的方向,将会是极大的帮助。
以下是起始代码:
我获得的信息如下: http://python-pptx.readthedocs.io/en/latest/user/quickstart.html 幻灯片布局
以下是起始代码:
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 幻灯片布局