I’m running an asynchronous long-running process with popen
. If I’m interested in getting all the data written to stdout, can I just do
cmd = popen(...)
for line in cmd.readline()
... do something with line
I’m wondering if I need to test cmd.poll()
at any point, or can I just assume that once the process is done, readline
will return EOF?