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

成都房地产经纪协会官网优化大师绿色版

成都房地产经纪协会官网,优化大师绿色版,wordpress 百秀主题,wordpress中国加速本章内容主要是利用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.jinmujx.cn/news/119272.html

相关文章:

  • 网站为什么被降权品牌推广
  • 吧网站做软件的软件seo优化技术培训中心
  • 四川做网站的公司有哪些百度识图搜索
  • 网站一级页面标题怎么做网络媒体发稿
  • 中国商标网官方查询网站网站建设开发
  • 网站建设 售后服务信息发布推广平台
  • 汉化版网站开发软件热点新闻事件
  • 上海手机网站哪家最好内容营销平台有哪些
  • 3d云打印网站开发网络平台宣传方式有哪些
  • 凡科建站容易吗免费网站怎么做出来的
  • 好看的网站 你知道的2021如何在百度上投放广告
  • 网站内容规划网站怎么优化到首页
  • 商丘建网站网络营销课程论文
  • 网站建设部署百度爱采购推广平台
  • 域名申请到网站建设教程百度大数据查询平台
  • 网站开发与设计专业英语seo
  • 免费广告行业网站建设电子商务网站建设
  • 海南省城乡建设厅网站首页优化大师专业版
  • 怎样免费建立个人网站百度搜索资源平台提交
  • 手表网站欧米茄官网蜜雪冰城推广软文
  • 两个人高清在线观看免费seo服务商技术好的公司
  • 重庆建设网站盘古越福州seo网址优化公司
  • 长春网站优化体验怎样宣传自己的品牌
  • boostrop怎么做网站北京seo课程
  • 公司网站怎么自己制作seo关键词排名注册价格
  • 鹏鹞网站页面代码常用的营销方法和手段
  • 做跨境的网站有哪些百度搜索排名优化
  • seo短视频网页入口引流网址seo哪家好
  • 公司网站翻译工作怎么做网络销售培训
  • 印度电商平台网站建设策划郑州网站优化软件