我必须阅读 pptx 文件。在 reding 时,我将提取一些数据,但不是从幻灯片中提取所有数据。找到幻灯片样本。我能够读取除 {1,2,3} 选项数据之外的所有数据。我也想读
这是代码。
from pptx import Presentation
prs = Presentation(path_to_presentation)
# text_runs will be populated with a list of strings,
# one for each text run in presentation
text_runs = []
for slide in prs.slides:
for shape in slide.shapes:
if not shape.has_text_frame:
continue
for paragraph in shape.text_frame.paragraphs:
for run in paragraph.runs:
text_runs.append(run.text)