Python Write Subprocess stdout stderr para arquivo
with open("stdout.txt","wb") as out, open("stderr.txt","wb") as err:
subprocess.Popen("ls",stdout=out,stderr=err)
Outrageous Octopus