首页 > 其他 > 详细

非常简单的终端小时钟

时间:2015-02-06 20:26:21      阅读:288      评论:0      收藏:0      [点我收藏+]
python 未入门,练练手,锻炼一下智力。只适合跟我一样的菜鸟 #coding = utf-8 import time import sys count = 0 m = 0 mm = 0 h = 0 hh =0 while True: for i in range(0,11): if i < 10: time.sleep(1) sys.stdout.write("\r%s%s:%s%s:%s%s" %(hh,h,mm,m,count,i)) sys.stdout.flush() else : if i == 10: # s count +=1 if count == 6: m +=1 if m ==10: mm +=1 if mm == 6: h +=1 if h == 10: #s hh +=1 h = 0 else : if hh ==2 and h == 4: print "The second day has come!! welcome to you !! " count = 0 m = 0 mm = 0 h = 0 hh = 0 break mm = 0 m = 0 count = 0 continue

非常简单的终端小时钟

原文:http://www.cnblogs.com/lcmemo/p/4277862.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!