pipes and commands

Carel Fellinger cfelling at iae.nl
Sun Oct 31 21:58:30 EST 1999


Gregor Zych <zych at pool.informatik.rwth-aachen.de> wrote:
> 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.

I tried something like the above on my linux machine, and no problemo.
this is what I did:

import os
os.system('/usr/bin/gs -q -dNOPAUSE -sDEVICE=pbmraw -r600x600 ' +\
          '-sOutputFile=- myfile.ps quit.ps | cat >/tmp/pipo')

Looking closer at your example i notice that your input file is encapsulated,
trying the above on a .eps file...
well this produces no output...
Unless I replace quit.ps with -c showpage quit
maybe pnmcut or pnmtotiff can't handle empty files?

hope this will get you on the right track.

-- 
groetjes, carel




More information about the Python-list mailing list