pipes and commands

Gregor Zych zych at pool.informatik.rwth-aachen.de
Sat Oct 30 11:45:15 EDT 1999


"Tim Evans" <tre17 at student.canterbury.ac.nz> writes:

> 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.
Tell me where I can change the resolution and I'll do it. 

The problem is the invocation of ghostscript. It seems to be a python
issue. You can pipe "pnm??? .... | pnm???? ... | pnm??? |" BUT you
can't pipe ghostscript to another program.
> 
> 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
Ciao
	Gregor




More information about the Python-list mailing list