Last active
August 11, 2021 17:55
-
-
Save sergiolucero/2af21972ed514cffcba6d4580721f076 to your computer and use it in GitHub Desktop.
PPT compiler
This file contains 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
from pptx import Presentation | |
from pptx.util import Inches | |
import glob | |
SLIDE_LAYOUT_TITLE_AND_CONTENT = 1 | |
FILTER = 'fotos/*.jpg' # what to include | |
prs = Presentation() | |
slide_layout = prs.slide_layouts[SLIDE_LAYOUT_TITLE_AND_CONTENT] | |
for fn in glob.glob(FILTER): | |
slide = prs.slides.add_slide(slide_layout) | |
slide.shapes.add_picture(fn, Inches(1), Inches(1)) | |
prs.save('compilado.pptx') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
slide.shapes.add_picture(fn, Inches(0), Inches(0),
width=pptx.util.Inches(12), height=pptx.util.Inches(8))