subprocess.Popen() problem

7stud bbxx789_05ss at yahoo.com
Tue Jun 26 23:58:47 CEST 2007


On Jun 26, 3:00 pm, "Jerry Hill" <malaclyp... at gmail.com> wrote:
> On 6/26/07, 7stud <bbxx789_0... at yahoo.com> wrote:
>
> > p.stdin.write("hello")
>
> You need to add the linefeed, otherwise your mytest.py process is
> still waiting for you to finish typing.  So, use this instead:
>
> p.stdin.write("hello\n")
>

Arggh. Of course!  Thanks

>Never tried this, but I think you need to use the communicate method
>detailed here:

Yes, communicate() will work too, but communicate reads stdout into a
string(i.e. into memory), and I don't want to do that.  Thanks.




More information about the Python-list mailing list