首页 > 其他 > 详细

30秒倒计时

时间:2019-12-02 13:02:10      阅读:66      评论:0      收藏:0      [点我收藏+]
 1 from tkinter import *
 2 counter = 30
 3 def run_counter(digit):
 4     def counting():
 5         global counter
 6         counter -= 1
 7         digit.config(text=str(counter))
 8         digit.after(1000,counting)
 9     counting()
10 root = Tk()
11 root.title("30秒倒计时")
12 digit=Label(root,bg="yellow",fg="blue",height=3,width=10,font="Helvetic 20 bold")
13 digit.pack()
14 run_counter(digit)
15 
16 root.mainloop()

技术分享图片

30秒倒计时

原文:https://www.cnblogs.com/zmzzm/p/11969770.html

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