Created
December 18, 2018 18:13
-
-
Save prashant-shahi/aacfccbcd3f8ab64d0e3b092fae63dcf to your computer and use it in GitHub Desktop.
PPTX to text extractor using pptx-python package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from pptx import Presentation | |
| if len(sys.argv) > 1: | |
| prs = Presentation(sys.argv[1]) | |
| else: | |
| exit("Error: Add pptx file in next argument") | |
| 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: | |
| print run.text | |
| print '\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment