Timer events

Daniel 'Dang' Griffith noemail at noemail4u.com
Tue May 18 09:13:15 EDT 2004


On Tue, 18 May 2004 00:48:05 GMT, "EAS" <eriksp at attbi.nospam.com>
wrote:

>While this topic is still up, can someone look at my program and tell me how
>to keep the total time in one place? (meaning updating it instead of
>printing it each time.)
[snip]
>    print h, ":", m, ":", s
[snip]

This works on the Windows machine I'm 
using; I don't have a Unix box handy:

Change:
    print h, ":", m, ":", s
to:
    print h, ":", m, ":", s, '\x0d',
or:
    print "%02d:%02d:%02d\x0d" % (h, m, s),

By putting a comma at the end, the 
cursor doesn't move to the next line.
By making the carraige return character
the last thing to print, the cursor 
moves to the start of the current line.
The next time the time is displayed, it 
overwrites the previous value, making it
look like it stays in place.

If you're running inside of an IDE, I 
have no idea if this will work for you.
    --dang




More information about the Python-list mailing list