python-pptx 包的新功能。 https://python-pptx.readthedocs.io/en/latest/ 想插入图片到PowerPoint。如何设置图片的宽度和高度?
我现在拥有的代码:
from pptx import Presentation
from pptx.util import Inches
img_path = 'monty-truth.png'
prs = Presentation()
blank_slide_layout = prs.slide_layouts[6]
slide = prs.slides.add_slide(blank_slide_layout)
left = top = Inches(1)
pic = slide.shapes.add_picture(img_path, left, top)
prs.save('test.pptx')