How to redirect the output of python script cmd to file?
So I have a python script that prints text to the console and I need it to write to a file instead, but the script is quite complex and I am not coding python, so I would not change it.
I want to do it
>python script.py arg1 arg2 ... argn > "somefile.txt"
But it does not work, and I guess that python takes >
and "somefile.txt"
as arguments.
Can this be done and how?
+3
source to share