Similar questions have been answered for example here or here.
Building upon the answers provided I am trying to overwrite the last output line in a Spyder console using
interval = 1
for i in range(0,10):
print(i, end = "\r")
time.sleep(interval)
which gives me the following, unexpected output:
0123456789
If i reduce the sleep interval to something short interval = 0.01
, then I get the output I would expect
9
How can the timing of these consecutive print statements influence what is being printed? And more importantly how do I get my pretty output? This happens only when I use Spyder (3.2.6) and does not occur in a regular Python console.