RPA/Python

[python-pptx] 파일 내 모든 슬라이드의 텍스트 상자 내용 읽기

꼰대 2021. 5. 7. 20:18

from pptx import Presentation



prs = Presentation('demo.pptx')

 

text_runs = []

 

for slide in prs.slides:

    for shape in slide.shapes:

        if shape.has_text_frame:

            for para in shape.text_frame.paragraphs:

                for run in para.runs:

                    text_runs.append(run.text)

 

print(text_runs)

반응형