I noticed that in python when I use a print statement, that it doesn't print immediately. I found you can use sys.stdout.flush()
to make it show the print in the console.
Is this the proper way of getting immediate feedback from a script, or is there a better way?
I mainly want this for debugging. I had a hang and was trying to find where the code stalled, but since my print statements didn't show up I was searching in the wrong place, thinking my code didn't get to the print statement. (I finally found it with breakpoints, which is perhaps a better way of debugging, but print immediate-prints are just more convenient sometimes.)