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

建筑网78广州网站优化平台

建筑网78,广州网站优化平台,西安seo,南阳卧龙区高端网站建设口碑本章内容主要是利用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.mmbaike.com/news/107342.html

相关文章:

  • 国家市场监管总局官网网站友链交易交易平台
  • 小型网站开发要多少钱如何制作网页最简单的方法
  • 做ppt什么网站图片好aso推广优化
  • wordpress中文字体库关键词推广优化外包
  • 做网站 就上凡科建站seo站长工具下载
  • 做ppt网站有哪些内容怎么制作网址
  • 电子商务网站建设中超能搜索引擎系统网站
  • 勉费申请做网站哈尔滨电话本黄页
  • 太阳能建设网站海底捞口碑营销案例
  • 临沂百度网站推广小视频网站哪个可以推广
  • 注册网站卖东西网络推广工作能长久吗
  • https证书 wordpress奇零seo赚钱培训
  • 为什么要建立网站移动建站优化
  • 嘉兴建站公司徐州百度seo排名优化
  • 公司名字大全集免费百度seo软件首选帝搜软件
  • 北关网站制作百度推广登陆入口官网
  • 重庆铜梁网站建设公司seoul是哪个国家
  • 国际网站群建设方案营销软文推广平台
  • 个人网站建设软件引擎优化是什么工作
  • 西安做网站找哪家公司好网站搜索引擎优化的基本内容
  • 网站在阿里云备案最好的关键词排名优化软件
  • 网站建设最新教程石家庄seo网络推广
  • 网站设计的公司如何选广东深圳龙华区
  • 可以在电脑做公务员题的网站360网站收录提交入口
  • 网站运营培训机构附近电脑培训速成班一个月
  • 部署php网站互联网营销案例
  • 包图网官网湖南seo推广
  • 怎么制作图片加文字带声音的视频seo的作用
  • 吕梁市网站建设公司律师推广网站排名
  • 众车网是哪家公司网站泰州网站建设优化