I\'m using Python\'s subprocess.communicate() to read stdout from a process that runs for about a minute.
subprocess.communicate()
How can I print out each line of that process
If you want a non-blocking approach, don't use process.communicate(). If you set the subprocess.Popen() argument stdout to PIPE, you can read from process.stdout and check if the process still runs using process.poll().
process.communicate()
subprocess.Popen()
stdout
PIPE
process.stdout
process.poll()