Created
March 25, 2015 02:16
-
-
Save gbrennon/674226e6a0476fcb32e9 to your computer and use it in GitHub Desktop.
Miguel Argolo presentation script
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 | |
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