Calling Ghostscript from Python

Kerstin kerstin.dressler at web.de
Fri Nov 9 09:08:46 EST 2001


Hi,

I'm trying to call the ghostscript to convert some PS to PDF. I'm
working on Win95, so the os.system() always returns '0'.
When the cmd is running, the DOS-Box opens and I get the error message
"File or directory not found".
I also checked if the PS are readable; and when I change the cmd to
something else (like "md new_dir") it works.

ghost_dir = 'c:\ghost\gs\gs7.00\lib'
cmd = ghost_dir + '\ps2pdf13.bat ' + ps_file + ' ' + pdf_file
os.system(cmd)

I think there must be something wrong with the pathname or rather the
ghost environment. How can I check this?
I'm using full pathnames for 'ps_file' and 'pdf_file' too! Might this
cause problems?

Can anybody help me?
Thanx,
Kerstin



More information about the Python-list mailing list