Originally posted by mkstevo
...it would be nice to show a progress count every five seconds or so . I tried using print statements every five seconds , but this causes a lot of other text to flash past as well as my message.
Hi,
I'm not sure what you want, but in python you can add to a line on the screen (rather that add a newline) and use backspaces, etc. using the sys.stdout.write() command. Something like this, I guess.
Code:
import sys
import time
sys.stdout.write(u"Countdown: ")
i = 20
while i:
sys.stdout.write(`i`)
time.sleep(1)
if i > 10:
sys.stdout.write('\b\b')
elif i == 10:
sys.stdout.write('\b\b ')
else:
sys.stdout.write('\b')
i -= 1
(Although I'm sure you could do better)
M.