Interacting with Subprocesses

Akira Li 4kir4.1i at gmail.com
Wed May 4 21:05:30 EDT 2016


Terry Reedy <tjreedy at udel.edu> writes:

> On 5/4/2016 2:41 PM, Dick Holmes wrote:
>> I am attempting to write a Python program that will interact with
>> a (non-Python) process. The programs will run under MinGW. The
>> process can use stdin/stdout commands and responses and can work
>> with pipes. The problem I'm having is that I can't find any
>> way in Python to have a continuing dialog with the process. I
>> have tried Popen communicate, but that protocol seems to be
>> limited to a single message/response pair, and the response
>> is not returned to the message originator until the process
>> terminates. Unfortunately I don't have access to the process'
>> source code so I can't change the communication medium.
>>
>> Is there some feature that will allow me to initiate the process
>> and execute multiple message/response pairs between the Python
>> program and the process during a single execution of the process?
>
> I have been told that multiprocessing works better for this.  Not sure
> is true.

OP wants to interact with a *non-Python* process—*multiprocessing*
module won't help here.




More information about the Python-list mailing list