Python Subprocess Interaction, Why Does My Process Work With Popen.communicate, But Not Popen.stdout.read()?
I am trying to communicate with a command-line chat bot with Python using the subprocess module. (http://howie.sourceforge.net/ using the compiled win32 binary, I have my reasons!)
Solution 1:
One major difference between the two is that communicate() closes stdin after sending the data. I don't know about your particular case, but in many cases this means that if a process is awaiting the end of the user input, he will get it when communicate() is used, and will never get it when the code blocks on read() or readline().
Try adding Popen.stdin.close() first and see if it affects your case.
Post a Comment for "Python Subprocess Interaction, Why Does My Process Work With Popen.communicate, But Not Popen.stdout.read()?"