Python implements operations on pptfiles,
This example describes how to operate a pptfile in Python. Share it with you for your reference. The specific analysis is as follows:
The following code can be used for powerpoint files. You can specify the slide pages to be captured. You need to install powerpoint on the local machine and specify the size and resolution.
Import osimport comtypes. clientdef export_presentation (path_to_ppt, path_to_folder): if not (OS. path. isfile (path_to_ppt) and OS. path. isdir (path_to_folder): raise "Please give valid paths! "Powerpoint = comtypes. client. createObject ("Powerpoint. application ") # Needed for script to work, though I don't see any reason why... powerpoint. visible = True powerpoint. open (path_to_ppt) # Or some other image types powerpoint. activePresentation. export (path_to_folder, "JPG") # You can write it here: # Presentation. slides [1]. export ("C:/path/to/jpg.jpg", "JPG", 800,600); powerpoint. presentations [1]. close () powerpoint. quit ()
I hope this article will help you with Python programming.