A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-January/085484.html below:

[Python-Dev] subprocess crossplatformness and async communication

[Python-Dev] subprocess crossplatformness and async communication [Python-Dev] subprocess crossplatformness and async communicationDaniel Stutzbach daniel at stutzbachenterprises.com
Mon Jan 26 16:19:01 CET 2009
I'm confused.  What's wrong with the following?

    p = Popen('do_something', stdin=PIPE, stdout=PIPE)
    p.stdin.write('la la la\n')
    p.stdin.flush()
    line = p.stdout.readline()
    p.stdin.write(process(line))
    p.stdin.flush()

If you want to see if data is available on p.stdout, use the select module
(unless you're on Windows).

The child process has to flush its output buffer for this to work, but that
isn't Python's problem.

--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090126/e0466e2f/attachment.htm>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4