Python3 读取WPS PPT
from pptx import Presentation def read_ppt(filepath): pptx = Presentation(filepath) # 打开PPT for slide in pptx.slides: # 获取幻灯片页 if shape.has_text_frame: # 判断是否包含文本框 text_frame = shape.text_frame # 获取文字内容 for paragraph in text_frame.paragraphs: for run in paragraph.runs: print(run.text)
参考链接:https://cloud.tencent.com/developer/article/1708628
还没有评论,来说两句吧...