[Tutor] pipes

Eugene Leitl Eugene.Leitl@lrz.uni-muenchen.de
Mon, 21 May 2001 17:34:52 +0200 (MET DST)


I'm trying to write the unix commandline idiom of

$ prog1 123 | prog2

bash-2.01$ cat rxid2png
#!/usr/local/bin/bash

echo "Content-type: image/png"
echo ""
./webdsp1 15 | ./dispreact





In Python, calling above as

import os
os.system('rxid2png')


does what I want. I want to get rid of the shell
by using pipes.


How do I hook up the output of below to the second program?

import os, sys

pipe = os.popen('webdsp1')
print pipe.read()


Sorry for being terse, I'm using pine over ssh over a loaded link.

TIA