read a process output with subprocess.Popen
ashokprabhuv at gmail.com
Thu Feb 4 13:28:20 CET 2010
I m trying a read the output of a process which is running
continuously with subprocess.Popen. However the readline() method
hangs for the process to finish. Please let me know if the following
code can be made to work with subprocess.Popen with threads or queues.
I tried a lot of methods but to no avail. It would be great if someone
can make it work.
p1 = subprocess.Popen('tail -f /var/log/
p2 = subprocess.Popen('grep
line = p2.stdout.readline()
More information about the Python-list