Le 28 mars 2014 21:59, "Terry Reedy" <tjreedy@udel.edu> a écrit :
>
> On 3/28/2014 6:20 AM, Victor Stinner wrote:
>
>> Full example of asynchronous communication with a subprocess (the
>> python interactive interpreter) using asyncio high-level API:
>
> However, the code below creates a subprocess for one command and one response, which can apparently be done now with subprocess.communicate. What I and others need is a continuing (non-blocking) conversion with 1 and only 1 subprocess (see my response to Josiah), and that is much more difficult. So this code does not do what he claims his will do.

I tried to write the shortest example showing how to read and send data and how to make the call blocking. It's different to communicate() because write occurs after the first read.

It should be quite easy to enhance my example to execute more commands.

Victor