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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -