First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
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")
2 | No.2 Revision |
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')