for i in range(0, 100):
print(i, end="\r")
Works as expected, where it writes the next number to sys.stdout in the same position as the last number
0
1
...
100
But if the numbers decrease, such as
for i in range(101, 0, -1):
print(i, end="\r")
It spits out something like:
100 # this is supposed to be 100
990 # 99
980 # 98
...
100 # 1
Any ideas?
I did attempt to use the \b
trick, but that yielded the same result as using \r
.
I also did the same with flush=True
, but no difference
I was expecting the line to be completely void of any previous number that came before it, such as
100
99
98
...
1