Python print stops printing

I’ve created a script that only prints a dot (.) when a process with a tag has been processed. For every process there can be a couple of hunderds of dots printed. I noticed that after a while the dot’s didn’t appear anymore.

A bit of googling gave me the answer:
End the print statement with “, flush=True” and then the print command will output immediately.

So the command
print('.', end='')
needs to be changed to
print('.', end='', flush=True)

URL: https://stackoverflow.com/questions/25897335/why-doesnt-print-output-show-up-immediately-in-the-terminal-when-there-is-no-ne