av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

您的位置:首頁技術文章
文章詳情頁

python使用tkinter實現屏幕中間倒計時

瀏覽:103日期:2022-06-26 09:30:43

本文實例為大家分享了python實現屏幕中間倒計時的具體代碼,供大家參考,具體內容如下

先看下效果圖:

python使用tkinter實現屏幕中間倒計時

代碼:

import timefrom tkinter import Tk,Labelclass TimeShow():#實現倒計時 def __init__(self,time_show=5): self.timeShowWin=Tk() self.timeShowWin.overrideredirect(True) self.timeShowWin.attributes(’-alpha’,1) self.timeShowWin.attributes(’-topmost’,True) self.timeShowWin.attributes(’-transparentcolor’,’black’) self.time_show = time_show self.time_label=Label(self.timeShowWin,text=’倒計時{}秒’.format(self.time_show),font=(’楷體’,25),fg=’red’,bg=’black’) self.time_label.pack(fill=’x’,anchor=’center’) self.timeShowWin.geometry(’+’+str(int(self.timeShowWin.winfo_screenwidth()/2))+’+’+str(125)) self.timeShowWin.after(1,self.show) def show(self): while self.time_show >= 0: print(’time_label={}’.format(self.time_label)) self.time_label[’text’]= ’倒計時{}秒’.format(self.time_show) self.timeShowWin.update() self.time_show -= 1 time.sleep(1) self.timeShowWin.destroy() def start(self): print(’ok’) self.timeShowWin.mainloop() if __name__ == ’__main__’: a=TimeShow(10) a.start()

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 久久九九网站 | 日本不卡一区二区三区在线观看 | 国产精品一区一区三区 | 欧美激情99| h在线看| 国产精品视频导航 | 久久男人天堂 | 少妇av片 | 日韩区 | 亚洲一区二区在线播放 | www国产亚洲精品久久网站 | 最新中文字幕在线 | www.黄色片视频 | 精品久久久久久久久久久久久 | 91香蕉| 国产一级精品毛片 | 成年人在线视频 | 久久综合久色欧美综合狠狠 | 亚洲在线一区二区三区 | 免费成人av | 一区二区三区免费在线观看 | 精品国产乱码久久久久久果冻传媒 | 精品综合久久久 | 在线免费观看黄网 | av一级久久 | 国产精品一区久久久 | 久久一区二 | 成人高清视频在线观看 | 日日夜夜av | 亚洲一区二区三区在线 | 久久久久久网站 | 毛片在线免费 | 一区二区三区影院 | 国产女人与拘做受视频 | 在线欧美亚洲 | 九色 在线 | 国产免费视频 | 亚洲精品 在线播放 | 91精品国产91久久久久久 | 精品美女| 欧美在线观看一区二区 |