我必须编辑包含如下表的pptx模板:
如何将python dict中存储的值附加到空字段中? 我使用的是pptx模块,但我找不到任何这样做的例子。在
from pptx import Presentation
prs = Presentation('template.pptx')
slide = prs.slides[2] #<- This is the slide that contains the table
shape = slide.shapes #<- As I understood This gives access to the shapes
textframe=shape.textframe
textframe.clear()
prs.save('test.pptx') #<- Saves the new file
引自python ppty developer的dev组
-如果你知道它的索引,类似
table = slide.shapes[2]
的东西就可以了。 然后,在更改单元格内容之前,您需要导航这些单元格:像这样的东西
相关问题 更多 >
编程相关推荐