Terry Carroll wrote:

import time
for t in range(10,0, -1):
    print "%s \x0D" %t,
    time.sleep(1)
print # get to next line
print "Done!"

Which operating system and terminal did you use?

In my experience, using print is not satisfactory, because the print command buffers the output and doesn't actually print anything until either a newline or you have a certain number of characters. So the above will queue up the following string:

"10 \r9 \r8 \r7 \r6 \r5 \r4 \r3 \r2 \r1 \r\n"

before anything becomes visible, and of course that just looks like "1".



--
Steven

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to