Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import os.path
- import win32com
- import win32com.client
- import time
- def ppt2pptx(file):
- powerpoint = win32com.client.Dispatch('PowerPoint.Application')
- win32com.client.gencache.EnsureDispatch('PowerPoint.Application')
- powerpoint.Visible = 1
- ppt = powerpoint.Presentations.Open(file)
- ppt.SaveAs(file[:-4]+'.pptx')
- powerpoint.Quit()
- path = 'C:\\Users\\cyy\\Desktop\\ppt\\王克金电子类6章\\'
- for subPath in os.listdir(path):
- s = os.path.join(path,subPath)
- if (s.endswith('.ppt')):
- print(s)
- ppt2pptx(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement