[Python] Call the WPS V9 API to convert PPT to PDF and pythonwps.
WPS APIs, that is, COM, are mainly divided into V8 and V9 versions. examples that are easy to find on the Internet are V8. You can download the V9 API on the official website.
Python needs to install Python for Windows Extensions to call COM, that is, pywin32.
The call is simple. The Code is as follows:
Import sysimport osimport win32com. clientargc = len (sys. argv) print ("Number of arguments:", argc, 'arguments. ') print ('argument List:', str (sys. argv) if argc <2: sys. exit (-1) src = sys. argv [1] dst = sys. argv [2] wpp = win32com. client. dispatch ("Kwpp. application ") # o. visible = Falseppt = wpp. presentations. open (src) ppt. saveAs (dst, 32) ppt. close () wpp. quit () sys. exit (0)
Call time:
Xxx. py "src" "dst"
The first parameter is the source path.
The second parameter is the target path.
Address: http://www.cnblogs.com/gaoshang212/p/4896539.html