#!/usr/bin/python #coding: utf-8 import sys from pptx import Presentation if __name__ == '__main__': prs = Presentation(sys.argv[1]) c = 1 for slide in prs.slides: print("# Slide " + str(c)) s = 1 for shape in slide.shapes: if not shape.has_text_frame: continue if s == 1: print("## " + shape.text_frame.paragraphs[0].text + "\n") else: for paragraph in shape.text_frame.paragraphs: print(" " * (paragraph.level) + "*"), print(paragraph.text) s = s + 1 if slide.has_notes_slide: print("\n"), print(slide.notes_slide.notes_text_frame.text + "\n") c = c + 1
必要があって。