Creating a timer in python

后端 未结 13 2221
孤独总比滥情好
孤独总比滥情好 2020-12-07 18:58
import time
def timer():
   now = time.localtime(time.time())
   return now[5]


run = raw_input(\"Start? > \")
while run == \"start\":
   minutes = 0
   current_         


        
13条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 19:31

    import time
    def timer(n):
        while n!=0:
            n=n-1
            time.sleep(n)#time.sleep(seconds) #here you can mention seconds according to your requirement.
            print "00 : ",n
    timer(30) #here you can change n according to your requirement.
    

提交回复
热议问题