Create two readers as above, one for stdout
one for stderr
and start each in a new thread. This would append to the list in roughly the same order they were output by the process. Maintain two separate lists if you want.
i.e.,
p = subprocess.Popen(["the", "command"])
t1 = thread.start_new_thread(func,stdout) # create a function with the readers
t2 = thread.start_new_thread(func,stderr)
p.wait()
# your logic here