修改为:
和删除文本变成下面:
请配详细解答,如各个函数,方法的作用,谢谢大家。
from pptx import Presentation
prs = Presentation('test.pptx')
for slide in prs.slides:
for shape in slide.shapes:
if shape.has_text_frame:
text_frame = shape.text_frame
if '大明星' in text_frame.text:
text_frame.text='小明星'
if '文本框' in text_frame.text:
text_frame.text=''
prs.save('test1.pptx')