Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #108154

Re: Interacting with Subprocesses

From Terry Reedy <tjreedy@udel.edu>
Newsgroups comp.lang.python
Subject Re: Interacting with Subprocesses
Date 2016-05-04 20:33 -0400
Message-ID <mailman.393.1462408447.32212.python-list@python.org> (permalink)
References <MPG.3193e21979405e40989683@news.supernews.com> <nge4dn$r4b$1@ger.gmane.org>

Show all headers | View raw


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.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Interacting with Subprocesses Dick Holmes <encore1@cox.net> - 2016-05-04 11:41 -0700
  Re: Interacting with Subprocesses Akira Li <4kir4.1i@gmail.com> - 2016-05-05 00:04 +0300
  Re: Interacting with Subprocesses Terry Reedy <tjreedy@udel.edu> - 2016-05-04 20:33 -0400
  Re: Interacting with Subprocesses Akira Li <4kir4.1i@gmail.com> - 2016-05-05 04:05 +0300
  Re: Interacting with Subprocesses eryk sun <eryksun@gmail.com> - 2016-05-05 04:38 -0500

csiph-web