Skip to content

Instantly share code, notes, and snippets.

@junhoyeo
Last active June 16, 2019 02:19
Show Gist options
  • Select an option

  • Save junhoyeo/373b08b1e6cff434acf1f8cd6d275b6d to your computer and use it in GitHub Desktop.

Select an option

Save junhoyeo/373b08b1e6cff434acf1f8cd6d275b6d to your computer and use it in GitHub Desktop.
PPT Output Images to PPTX backgrounds
from pptx import Presentation
from pptx.util import Inches
prs = Presentation()
prs.slide_width = 11887200
prs.slide_height = 6686550
title_slide_layout = prs.slide_layouts[0]
for i in range(1, int(input()):
slide = prs.slides.add_slide(title_slide_layout)
slide.shapes.add_picture(f'./슬라이드{i:02d}.png',
Inches(0), Inches(0),
width=prs.slide_width,
height=prs.slide_height)
prs.save('output.pptx')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment