请问:如何使用python模块的pptx,对pptx里面文本框的内容进行修改?如将:我是大明星改为我是小明星,和把大明星删去的操作。

img
修改为:
img
和删除文本变成下面:
img
请配详细解答,如各个函数,方法的作用,谢谢大家。

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')