I want to start a child process and read its stderr, but so far, I can't read anything at all using subprocess.Popen, even stdout. I'm trying to use subprocess.communicate() to read from stdout and stderr. This is what I do:
import subprocess
p = subprocess.Popen('ls')
s = p.communicate()
print s
This gives me output (None, None). I think the pair is for stdin and stderr. Is that the case? Anyway, how can I read stdout and stderr from a process started with subprocess.Popen?