import os import glob from comtypes import client PPT_NAME = 'test.pptx' OUT_DIR = 'images' def export_img(fname, odir): application = client.CreateObject("Powerpoint.Application") application.Visible = True current_folder = os.getcwd() presentation = application.Presentations.open(os.path.join(current_folder, fname)) export_path = os.path.join(current_folder, odir) presentation.Export(export_path
