So for analysis, I want to save everything the scripts outputs on the console/terminal, and for that I used sys.stdout
:
My code:
sys.stdout = open('logFile.dat', 'w')
# TOO MUCH LINES OF CODE
sys.stdout.close()
My program is quite large, and there isn't point to copy-paste it here, because It doesn't affect my question.
So with this I get what I wanted but on the other hand, the console is blank while the program is running and that is a problem for me, because I want for program to output stuff on the console.
Is there anyway to get past this ?