Why isn't the content of `print` displayed immediately in the terminal?
I have a python script to simulate,
it takes quite a long time for a loop to run and each loop takes a long time to run, so I am typing
after each loop as a way of monitoring how fast it is running and how far it has gone through a statement
when the script is run.
for something: do something print '.',
However, when I run the script in iPython in the terminal, the dots are not printed one by one, instead, it prints them all at once when the loop finishes, making everything pointless. How can I print dots per line at startup?
source to share