osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subprocess Popen confusion


https://occovid19.ochealthinfo.com/coronavirus-in-oc I'm trying to 
communicate using a continuing dialog between two 
processes on the same system. I've looked at various mechanisms and the 
class that seems to fit my needs is Popen in the subprocess module, but 
I can't seem to get more than a single round-trip message through Popen. 
I first call Popen then poll using the identifier returned from the call 
and the poll seems to work. I then call the communicate function passing 
None as the value to send to the companion process stdin. I get the 
expected result, but I also get "Exception condition detected on fd 0
\\n" and "error detected on stdin\\n". Subsequent attempts to 
read/write/communicate with the subprocess fail because the file (stdxx 
PIPE) is closed.

I can't tell from the documentation if the communicate function is a 
one-time operation. I have tried using read but the read call doesn't 
return (I'm using winpdb-reborn to monitor the operations). 

I'm using Python 3.7, Windows 10, winpdb-reborn 2.0.0, rpdb2 1.5.0. If 
it makes any difference, I'm trying to communicate with GDB using the MI 
interpreter.

Thoughts and advice appreciated!

Dick