I made a timer that counts down from five minutes. This code runs fine but
I a seeing a cursor blinking on the first number as the code is running.
How do I avoid this?

I am using gnome-terminal and Python 2.6.6.


#!/usr/bin/python

import time
import sys
import os

def countd():

    seconds = 59
    minutes = 4
    five_minutes = 0

    os.system('clear')

    while five_minutes != 300:
        sys.stdout.write("%d:%02.f\r" % (minutes, seconds))
        sys.stdout.flush()
        seconds -= 1
        if seconds == -1:
            minutes -= 1
            seconds = 59

        five_minutes += 1
        time.sleep(1)

countd()



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

Reply via email to