1
我尝试启用自动导入图片,以防止每次手动广告100张图片。我似乎无法访问图片的占位符并用新图片替换它们。 一些正确的方向指导将有很大的帮助。python-pptx在布局中更改图片
代码我开始:
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