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

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

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

瀏覽:122日期: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 編程
相關文章:
主站蜘蛛池模板: 国产精品2区 | 中国黄色1级片 | 在线播放国产精品 | 久久精品国产视频 | 中文字幕在线观看网站 | 国产ts在线| 美日韩精品 | 日韩欧美高清 | 国产h片在线观看 | 国产主播av | 亚洲精品在线视频 | 国产一级特黄aaa大片 | 日韩欧美在线视频 | 精品一区av | 成人黄色小视频 | 成人91视频| 一区二区精品视频 | 日韩特级| 91禁蘑菇在线看 | 久久av在线| 九九热精品视频 | 亚洲精品黄色 | 不卡视频一区二区 | 成人在线视频观看 | 国产伦精品一区二区三区照片 | 91日韩在线 | 三级在线播放 | 激情高潮到大叫狂喷水 | 视频在线一区 | 一级特黄视频 | 日韩小视频 | 免费观看一区二区三区毛片 | 亚洲网站在线 | 欧美一区二区精品 | 久久精品视频网 | 中文字幕色哟哟 | 青青草免费在线观看视频 | 日韩国产精品视频 | 欧美一区二区三区在线播放 | 日日拍夜夜拍 | 精品国产一区二区在线观看 |