Last active
January 31, 2019 16:30
-
-
Save sergiolucero/7b243a4a932b12a8663d23bee3f9a896 to your computer and use it in GitHub Desktop.
bunch of pics to ppt
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
import glob, os, pptx, scipy.misc | |
from PIL import Image | |
size = 800,600 | |
prs = pptx.Presentation() | |
for fn in glob.glob('*.jpg'): | |
img = Image.open(fn) | |
img.thumbnail(size, Image.ANTIALIAS) | |
img.save(fn) | |
slide = prs.slides.add_slide(prs.slide_layouts[6]) | |
pic = slide.shapes.add_picture(fn, 0, 0) | |
prs.save("slideshow.pptx") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
puts all JPEGs in current directory into a powerpoint