亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

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

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

瀏覽:107日期: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 編程
相關文章:
主站蜘蛛池模板: 久久综合免费 | 国产欧美精品午夜在线播放 | 欧美亚洲日本一区二区三区浪人 | 欧美一级二级毛片视频 | 999久久精品国产 | 91国视频| 欧美日韩乱妇高清免费 | aabb片免费看 | 香蕉片视频在线观看 | 日本免费看片在线播放 | 国产精品福利午夜在线观看 | 高清在线一区二区 | 大ji吧快给我别停受不了视频 | 国产成人精品午夜二三区 | 亚洲欧美日韩国产精品 | 91免费短视频 | 黄网在线观看免费 | 老湿机一区午夜精品免费福利 | 成人永久免费高清 | 麻豆亚洲精品一区二区 | 日韩手机在线视频 | 国产真实偷乱视频在线观看 | 国产精品综合网 | 青青青视频精品中文字幕 | 91视频网址入口 | 亚洲无线一二三四手机 | 日本无卡无吗在线 | 精品国产3p一区二区三区 | 欧美毛片免费观看 | 亚洲国产精品久久久久666 | 一级免费黄色大片 | 久久亚洲日本不卡一区二区 | 亚洲黄毛片| 精品一区二区三区在线视频观看 | 免费日韩在线观看 | 亚洲网址 | 成人无遮挡毛片免费看 | 国产成人精品免费午夜 | 国产网站麻豆精品视频 | 国产91激情对白露脸全程 | 毛片网子 |