[EMAIL PROTECTED] wrote: > Hi. > > Can anyone tell me the python code for a simple countdown from eg. 2.00 > minutes. > > It should be printet out to the screen. > When it is finished it should write "Time is up" > > Hope you can help. >
You need the module ``time`` : import time start = time.time() lastprinted = 0 finish = start + 120 while time.time() < finish: now = int(time.time()) if now != lastprinted: print int(finish - now) lastprinted = now time.sleep(0.5) # this stops the system hanging whilst this is running print "Time is up" HTH Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Henrik -- http://mail.python.org/mailman/listinfo/python-list