Thursday, October 29, 2015

hanged subprocess and popen call

http://stackoverflow.com/questions/16768290/working-of-popen-communicate

https://docs.python.org/2/library/subprocess.html\

Do not use stdout=PIPE or stderr=PIPE with this function as that can deadlock based on the child process output volume. Use Popen with the communicate() method when you need pipes.


Use:
proc.stdin.flush() in the main while loop and a sys.stdout.flush() in the
child loop after the print should fix your problem.


No comments:

Post a Comment