python - How to get the stdout and stderr for subprocess.call? -


i'm using subprocess.call, , need output stdout , stderr. how can this?

notice check_output():

note not use stdout=pipe or stderr=pipe function. pipes not being read in current process, child process may block if generates enough output pipe fill os pipe buffer.

my call might produce lot of output, safe way output?

something work:

f = file('output.txt','w') g = file('err.txt','w')  p = subprocess.popen(cmd, shell=true, stdout=f, stderr=g)  f.close() g.close() 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -