读取ppt

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)    #打印每一段的内容

    

posted @ 2020-06-05 22:32  misherry  阅读(252)  评论(0编辑  收藏  举报