I'm confused. What's wrong with the following?<br><br> p = Popen('do_something', stdin=PIPE, stdout=PIPE)<br> p.stdin.write('la la la\n')<br> p.stdin.flush()<br> line = p.stdout.readline()<br>
p.stdin.write(process(line))<br> p.stdin.flush()<br> <br>If you want to see if data is available on p.stdout, use the select module (unless you're on Windows).<br><br>The child process has to flush its output buffer for this to work, but that isn't Python'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>