Being a Python noob I need to run a third party application (which writes its stdout into single line, they probably use something like skip_eol=True
), from within my python script and display the app's stdout live.
This
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
for line in iter(process.stdout.readline, b''):
print line.rstrip()
only allows me to get the stdout once the child process completed. I don't clearly understand how do I catch the entire stdout?