In my python script,
I am trying to run a windows program that prints output.
But I would like to redirect that output to a text file.
I tried
command = 'program' + arg1 + ' > temp.txt'
subprocess.call(command)
Where program is my program name and arg1 is argument it takes.
but it does not redirect the output to the text file
It just prints that on the screen.
Can anyone help me how to do this?
Thank you!
Pass a file object to the
stdoutparameter ofsubprocess.call():