I want to write results of some calculations to a file with print and print some other data like progress indication to Windows console so I can see it immediately.
What I write to console is: C:\Users\BoltKey>python program.py < in.txt > out.txt.
Is there a way to overload output redirection and print to console? Or is it just wrong and I should use file functions if I want to print to the console and into files at the same time?
Here is pseudocode:
for i in range(100): for j in range(100): result = getResult(i, j) print result // print to output file consolePrint "progress: " + str(i) + "%" // print to console