Use batch to redirect prints into a file
Solution 1:
you have 2 ways to do it:
-
in
cmd
->python script.py > log.txt
-
in your python code:
example:
import sys
sys.stdout = open(PATH_TO_LOG_FILE, "w")
print("hello world")
sys.stdout.close()
output: hello world
(in log text file)