当前位置: 首页 > news >正文

爱网站找不到了建站之星破解版

爱网站找不到了,建站之星破解版,做网站的网页图片素材怎么找,杭州做服装电商拿货的网站本章内容主要是利用python制作一个简单的桌面倒计时程序,包含开始、重置 、设置功能。 目录 一、效果演示 二、程序代码 一、效果演示 二、程序代码 #!/usr/bin/python # -*- coding: UTF-8 -*- """ author: Roc-xb """import tkin…

本章内容主要是利用python制作一个简单的桌面倒计时程序,包含开始、重置 、设置功能。

目录

一、效果演示

二、程序代码


一、效果演示

二、程序代码

#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: Roc-xb
"""import tkinter as tk
from tkinter import simpledialog
from tkinter import messageboxclass CountdownTimer:def __init__(self, root):self.root = rootself.root.title("倒计时程序")self.root.geometry("450x300")self.countdown_value = 60self.is_counting = Falseself.canvas = tk.Canvas(self.root, width=200, height=200, bg="white")self.canvas.place(x=20, y=20)self.countdown_label = tk.Label(self.root, text="倒计时: 60s", font=("Arial", 20))self.countdown_label.place(x=250, y=20)self.start_button = tk.Button(self.root, text="开始", command=self.start_countdown)self.start_button.place(x=250, y=70)self.reset_button = tk.Button(self.root, text="重置", command=self.reset_countdown)self.reset_button.place(x=250, y=120)self.set_button = tk.Button(self.root, text="设置", command=self.set_countdown)self.set_button.place(x=250, y=170)def start_countdown(self):if self.is_counting:returnself.is_counting = Trueself.countdown()def countdown(self):if self.countdown_value > 0 and self.is_counting is True:self.countdown_value -= 1self.countdown_label.config(text="倒计时: " + str(self.countdown_value) + "s")self.canvas.delete("all")self.canvas.create_rectangle(0, 200 - self.countdown_value * 2, 200, 300, fill="green")self.root.after(1000, self.countdown)elif self.countdown_value > 0 and self.is_counting is False:self.canvas.delete("all")self.is_counting = Falsereturnelse:self.is_counting = Falsemessagebox.showinfo("提示", "倒计时结束")def reset_countdown(self):self.is_counting = Falseself.countdown_value = 60self.countdown_label.config(text="倒计时: " + str(self.countdown_value) + "s")self.canvas.delete("all")def set_countdown(self):if self.is_counting:returnvalue = tk.simpledialog.askinteger("设置倒计时", "请输入倒计时时间(秒):", parent=self.root)if value is not None:self.countdown_value = valueself.countdown_label.config(text="倒计时: " + str(self.countdown_value) + "s")self.canvas.delete("all")if __name__ == '__main__':root = tk.Tk()app = CountdownTimer(root)root.mainloop()

http://www.yayakq.cn/news/663137/

相关文章:

  • 设计微信公众号的网站吗网站建设办法
  • 网站发布文章怎么才能让百度收录湖州做网站公司有那几家
  • 红叶网站开发工作室建设网站有什么法律么
  • 国外免费可以做网站的服务器长春网站建设找源晟
  • 学科网站建设管理电话销售-网站建设-开场白
  • 做移动端网站如何制作小程序
  • 网站的软文推广中国十大公司排名
  • 国外门户网站源码网站如何更新内容
  • 做网站用旧域名好不好买的网站模板会影响
  • 网站开发得多长时间wordpress插件wpslugtranslate
  • 网站开发什么意思wordpress 导航栏效果
  • 一个域名建多个网站最新app推广
  • 转化率的网站设计网站流量和带宽
  • godaddy wordpress空间郑州抖音seo
  • 以投资思维做网站三明市网站建设
  • 设计公司啊 网站做网站好
  • 如何评判网站建设岗位网站建设报告怎么写
  • 网站建设拍金手指谷哥14杭州最好的网站设计公司
  • 广州自来水公司网页设计seo 关键词优化
  • 系统官网网站模板下载安装工商企业信息查询网站
  • 豆瓣网网站建设企业宣传片制作公司天津
  • 网站建设网站定制开发行业网站cms
  • iis 设置网站不能访问网站的建设运营收费是哪些
  • 预付网站建设费会计处理百度快速收录在线提交工具
  • 福州seo网站建设人人建站
  • 企业网站建设方案价格设计网站建设常州
  • wordpress网站建设公司建设企业网站公
  • html网站建设代码留言板网站建设总结
  • 网站模板套用教程o2o手机网站源码
  • 网站建设哪些网站可以今朝装饰老房装修套餐