pipes and commands

Tim Evans tre17 at student.canterbury.ac.nz
Fri Oct 29 18:48:13 EDT 1999


Gregor Zych <zych at pool.informatik.rwth-aachen.de> writes:

> Hi!
> How can I get many commands connected with pipes executed. I try
> 
> startexe = 'gs -q -dNOPAUSE -sDEVICE=pbmraw -r600x600 -sOutputFile=- '+pfad+'/'+name+'.eps quit.ps | pnmcut 610 982 4023 5483 | pnmtotiff - > '+pfad+'/'+name+'.tif'
> os.system(startexe)
> 
> but the system just waits for ever until I interrupt it, although it
> gets the final file written correctly.
> os.popen() seems to make my system unusable 'cos it slurps the generated 
> file und these pictures are HUGE. Any hints are welcome.
> Linux 2.2.11 python 1.5.2
> Ciao
> 	Gregor

Not a Python solution, but the `convert' program from `imagemagick' is
really good at this sort of conversion (ps -> image) and can do all of
the above line in a single step IIRC, so you don't need the pipes.

It's not really an answer, but it might solve your problem.

The home page for imagemagick is:

http://www.wizards.dupont.com/cristy/ImageMagick.html

--
Tim Evans





More information about the Python-list mailing list