I&#39;m confused.&nbsp; What&#39;s wrong with the following?<br><br>&nbsp;&nbsp;&nbsp; p = Popen(&#39;do_something&#39;, stdin=PIPE, stdout=PIPE)<br>&nbsp;&nbsp;&nbsp; p.stdin.write(&#39;la la la\n&#39;)<br>&nbsp;&nbsp;&nbsp; p.stdin.flush()<br>&nbsp;&nbsp;&nbsp; line = p.stdout.readline()<br>
&nbsp;&nbsp;&nbsp; p.stdin.write(process(line))<br>&nbsp;&nbsp;&nbsp; p.stdin.flush()<br>&nbsp;<br>If you want to see if data is available on p.stdout, use the select module (unless you&#39;re on Windows).<br><br>The child process has to flush its output buffer for this to work, but that isn&#39;t Python&#39;s problem.<br>
<blockquote style="margin: 1.5em 0pt;">--<br>
Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com">Stutzbach Enterprises, LLC</a>
</blockquote>