I'm calling a python script (B) from another python script (A).
Using subprocess.call, how do I redirect the stdout of B to a file that specify?
I'm using python 2.6.1.
Pass a file as the stdout parameter to subprocess.call:
stdout
subprocess.call
with open('out-file.txt', 'w') as f: subprocess.call(['program'], stdout=f)
1.4m articles
1.4m replys
5 comments
57.0k users