SyntaxFix
Write A Post
Hire A Developer
Questions
You want to pass these extra parameters to subprocess.Popen:
subprocess.Popen
bufsize=1, universal_newlines=True
Then you can iterate as in your example. (Tested with Python 3.5)