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

objective c - Can't build GCM with Protobuf in Xcode -

ember.js - EmberJS Model find not up-to-date with underlying store -

javascript - jQuery iScroll clickable list elements while retaining scroll? -