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