[Tutor] (no subject)
Alan Gauld
alan.gauld at freenet.co.uk
Thu Dec 30 09:15:10 CET 2004
> I am trying to supply input to another program using
> pipes. I can read from it just fine, but writing to
> its stdin doesn't seem to be working.
I'm guessing here so take with a pinch of salt...
> cmd = "listen.py"
>
> #stdout, stdin
> r, w = popen2(cmd)
>
> w.write("Message sent")
I think you need a newline on the end otherwise raw_input
will not see it.
HTH,
Alan G.
More information about the Tutor
mailing list