from pptx import Presentation
prs=Presentation('名字.pptx')
for slide in prs.slides: # 读取每一页幻灯片
for shape in slide.shapes: #获取每一页的内容
if shape.has_text_frame: #判断是否有文本框架
text_frame=shape.text_frame
for paragraph in text_frame.paragraphs:
print(paragraph.text) #打印每一段的内容