读取ppt

 1 from   pptx  import  Presentation
 2 
 3 prs=Presentation('名字.pptx')
 4 
 5 for  slide  in  prs.slides:    # 读取每一页幻灯片
 6 
 7   for   shape   in  slide.shapes:   #获取每一页的内容
 8 
 9     if   shape.has_text_frame:   #判断是否有文本框架
10 
11       text_frame=shape.text_frame
12 
13       for   paragraph   in   text_frame.paragraphs:
14 
15         print(paragraph.text)    #打印每一段的内容
原文地址:https://www.cnblogs.com/luckiness/p/13080427.html