Following the description given here how to create output in python in such a way, that the previous output is overwritten, I tried the following code
from __future__ import print_function
import time
for val in range(10):
time.sleep(0.2)
print(val, end='\r')
but do not see any output at all. With end=\n
it works as expected (i.e. the numbers 0 to 9 in a vertical column). What is the reason I do not see any output? Do I need to flush something? Is this operating-system depended (working on Ubuntu Linux)?