讀取ppt

from   pptx  import  Presentation框架

prs=Presentation('名字.pptx')ide

for  slide  in  prs.slides:    # 讀取每一頁幻燈片io

  for   shape   in  slide.shapes:   #獲取每一頁的內容import

    if   shape.has_text_frame:   #判斷是否有文本框架im

      text_frame=shape.text_frameppt

      for   paragraph   in   text_frame.paragraphs:

        print(paragraph.text)    #打印每一段的內容

相關文章
相關標籤/搜索