Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One way to do it is to install Ghostscript, which contains program ps2pdf to convert from Postscript to pdf. Then execute the program inside Python with for example:

import os
os.system("ps2pdf diagram.ps diagram.pdf")

One way to do it is to install Ghostscript, which contains program ps2pdf to convert from Postscript to pdf. Then execute the program inside Python with for example:

import os
os.system("ps2pdf diagram.ps diagram.pdf")

All Postscript files in a folder may be processed with the following code:

import os
import glob
for f in glob.glob('*.ps'):
    os.system('ps2pdf '+f+' '+f[0:-3]+'.pdf')