This is what I ended up using:
import time
import sys
import os
def countd():
seconds = 59
minutes = 4
five_minutes = 0
os.system('clear')
os.system('setterm -cursor off')
while five_minutes != 300:
sys.stdout.write("\r%d:%02.f\t" % (minutes, seconds))
s
On 17/02/12 11:38, brandon w wrote:
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?
Try putting the carriage return at the start of the line. You print the
line then reset
On Fri, Feb 17, 2012 at 12:38 PM, brandon w wrote:
> 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
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 = 5