from pptx import Presentation prs=Presentation('名字.pptx') for slide in prs.slides: # 讀取每一頁幻燈片 for shape in slide.shapes: #獲取每一頁的內容 if shape.has_text_f ...
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) #列印每一段的內容