How do I print in Python 3.3.3 without carriage return?

Viewed 12312

First of all, I am NOT looking for how to print in the same line with the print(some_stuff, end="").

In Python 2.7 you could type:

while True:
for i in ["/","-","|","\\","|"]:
    print "%s\r" % i,

and it would print, in the SAME line, in the SAME spot those 5 characters, making it look like you had a bar spinning (actually you could try it out). The thing is, I can't do the same thing in Python 3.3, and I've tried several things. My specific application would be a countdown timer... The code is something like this:

import time
t = 120
while t > 0:
    t -= 1
    print("Time left till next update: %d seconds" % t)
    time.sleep(1)

where the output should be the string, with ONLY the number of seconds changing in place... Hope someone can help me with this.

2 Answers
Related