On 12/10/24 12:31, Roman Haefeli wrote:
It seems that Python's "print" buffers its output per default. The issue you experience seems not specific to [command], but happens also when you pipe the output to some other command, like in:
./counter.py | grep 2
You will see the '2' only appear when the whole script has finished running.
You can tell print to immediately flush the current buffer:
print(i, flush=True)
That did the trick, thanks!