Skip to content

Instantly share code, notes, and snippets.

@gbrennon
Created March 25, 2015 02:16
Show Gist options
  • Save gbrennon/674226e6a0476fcb32e9 to your computer and use it in GitHub Desktop.
Save gbrennon/674226e6a0476fcb32e9 to your computer and use it in GitHub Desktop.
Miguel Argolo presentation script
import glob
import goslate
import os
from pptx import Presentation
path = '/home/miguel/Downloads/slidestraduzir'
presentations=glob.glob(os.path.join(path,'*.pptx'))
gs=goslate.Goslate()
for ppt in presentations:
prs=Presentation(ppt)
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:
run.text=(gs.translate(run.text,'pt','en'))
prs.save(ppt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment