I'm trying to flush all of std out to a python file via:
sys.stdout = open('myfile.txt', 'w')
print("Starting work")
sys.stdout.flush()
whole bunch of stuff with prints and sys.stdout.flush() mixed in
print("ending work")
sys.stdout.flush()
Unfortunately, nothing prints until the script terminates. The file size remains 0 kb. I am doing this on a windows machine if that helps with python 2.7
Thank you!