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
Alternate approach
import subprocess p=subprocess.Popen('lsblk -l|tee a.txt',stdout=subprocess.PIPE,shell=True) (output,err)=p.communicate() p_status=p.wait() print output
Above code will write output of command to file a.txt