I am trying to grab stdout from a subprocess.Popen call and although I am achieving this easily by doing:
stdout
subprocess.Popen
cmd = subprocess.Popen(\'
cmd = subprocess.Popen(["ls", "-l"], stdout=subprocess.PIPE) for line in cmd.stdout: print line.rstrip("\n")
The call to readlines is waiting for the process to exit. Replace this with a loop around cmd.stdout.readline() (note singular) and all should be well.
readlines
cmd.stdout.readline()