国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

??國(guó)慶假期快到了,用python寫個(gè)倒計(jì)時(shí)程序,助你熬到假期!??

loonggg / 3824人閱讀

? ? ? ? 國(guó)慶假期快到了,想查查還有幾天幾小時(shí)到假期,這對(duì)程序員小菜一碟,輕輕松松用python寫個(gè)倒計(jì)時(shí)程序(天、時(shí)、分、秒),助你熬到假期!

一、先看效果:

?二、安裝python:

1、下載安裝python

下載安裝python3.9.6,進(jìn)入python官方網(wǎng)站://www.python.org/

?點(diǎn)擊Python 3.9.6

直接安裝即可。

2、驗(yàn)證安裝成功。

按win+R輸入cmd,打開控制臺(tái),輸入python -V,輸出python版本號(hào)說明安裝成功。

三、代碼

##import libraryfrom tkinter import *import timefrom datetime import datetime,timedelta################GUI to display window ##########################root = Tk()root.geometry("450x300")root.resizable(0,0)root.config(bg ="blanched almond")root.title("國(guó)慶倒計(jì)時(shí)")Label(root, text = "國(guó)慶倒計(jì)時(shí)" , font = "arial 20 bold", bg ="papaya whip").pack()############GUI to display current time#######################Label(root, font ="arial 15 bold", text = " 當(dāng)前時(shí)間:", bg = "papaya whip").place(x = 40 ,y = 70)#######################GUI to set the future time ##########Label(root, font ="arial 15 bold", text = " 到達(dá)時(shí)間:", bg = "papaya whip").place(x = 40 ,y = 110)#set yearyear_set = StringVar()Entry(root, textvariable =year_set , width = 4, font = "arial 12").place(x=175, y=115)Label(root, font ="arial 15", text = "-", bg = "papaya whip").place(x = 215 ,y = 110)year_set.set("0000")#set monthmonth_set= StringVar()Entry(root, textvariable =month_set, width =2, font = "arial 12").place(x=235, y=115)Label(root, font ="arial 15", text ="-", bg = "papaya whip").place(x = 260 ,y = 110)month_set.set("00")#set dayday_set= StringVar()Entry(root, textvariable =day_set, width =2, font = "arial 12").place(x=275, y=115)day_set.set("00")# set hourhour_set= StringVar()Entry(root, textvariable =hour_set, width =2, font = "arial 12").place(x=305, y=115)Label(root, font ="arial 15", text = ":", bg = "papaya whip").place(x = 330 ,y = 110)hour_set.set("00")# set minmin_set= StringVar()Entry(root, textvariable =min_set, width =2, font = "arial 12").place(x=345, y=115)Label(root, font ="arial 15", text = ":", bg = "papaya whip").place(x = 370 ,y = 110)min_set.set("00")# set secsec_set= StringVar()Entry(root, textvariable =sec_set, width =2, font = "arial 12").place(x=385, y=115)sec_set.set("00")#######################GUI to display timer countdown ##########Label(root, font ="arial 15 bold", text = " 倒計(jì)時(shí):", bg ="papaya whip").place(x = 40 ,y = 150)#storing secondssec = StringVar()Entry(root, textvariable = sec, width = 2, font = "arial 12").place(x=325, y=155)Label(root, font ="arial 15", text = "秒", bg = "papaya whip").place(x = 350 ,y = 150)sec.set("00")#storing minutesmins= StringVar()Entry(root, textvariable = mins, width =2, font = "arial 12").place(x=275, y=155)Label(root, font ="arial 15", text = "分", bg = "papaya whip").place(x = 300 ,y = 150)mins.set("00")# storing hourshrs= StringVar()Entry(root, textvariable = hrs, width =2, font = "arial 12").place(x=225, y=155)Label(root, font ="arial 15", text = "時(shí)", bg = "papaya whip").place(x = 250 ,y = 150)hrs.set("00")# storing daysdays= StringVar()Entry(root, textvariable = days, width =2, font = "arial 12").place(x=175, y=155)Label(root, font ="arial 15", text = "天", bg = "papaya whip").place(x = 200 ,y = 150)days.set("00")#########fun to display current time#############def clock(): clock_time = time.strftime("%Y-%m-%d %H:%M:%S %p") curr_time.config(text = clock_time) curr_time.after(1000,clock)curr_time =Label(root, font ="arial 15 bold", text = "", fg = "gray25" ,bg ="papaya whip")curr_time.place(x = 175 , y = 70)clock()##########fun to start countdown########def countdown(): #now = datetime.now() #end = datetime((year_set).get(),(month_set).get(),(day_set).get(),(hour_set).get(),(min_set).get(),(sec_set).get(),00); global seconds_now now = time.time() lt_ = time.strptime(f"{(year_set).get()} {(month_set).get()} {(day_set).get()} {(hour_set).get()} {(min_set).get()} {(sec_set).get()}", "%Y %m %d %H %M %S") end = time.mktime(lt_) times=int (end-now)  #.total_seconds()); while times > -1:  minute,second = (times // 60 , times % 60)    hour = 0  if minute > 60:   hour , minute = (minute // 60 , minute % 60)    day=0  if hour>24:    day,hour=(hour//24,hour%24)      sec.set(second)  mins.set(minute)  hrs.set(hour)  days.set(day)  root.update()  time.sleep(1)  times -= 1Button(root, text="START", bd ="5", command = countdown, bg = "antique white", font = "arial 10 bold").place(x=150, y=210)  root.mainloop()

四、運(yùn)行

打開工程文件,在地址欄里輸入cmd,按Enter回車,即打開控制臺(tái)。

?輸入python main.py,按回車就打開了程序GUI界面。

?到達(dá)時(shí)間填2021年10月1日,按start按鈕,就開始放假倒計(jì)時(shí)啦!

?相關(guān)資源:基于python的假期倒計(jì)時(shí)(天、時(shí)、分、秒).zip

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/121688.html

相關(guān)文章

  • ??國(guó)慶七天的總結(jié)

    今年國(guó)慶七天和以往就不一樣了,過去都是學(xué)生時(shí)代的國(guó)慶,大學(xué)時(shí)光以前在家有家人的陪伴,在大學(xué)階段也基本沒回過家。 這里說明一下不怎么回家的原因吧,因?yàn)槲依霞以谵r(nóng)村里,國(guó)慶階段是收集油茶樹果實(shí)的好時(shí)光,就從網(wǎng)上拿了一張圖,大概就是如下樣子,碩果累累(說不定有些小伙伴還不知道這啥,因?yàn)槲覇柫艘恍┡笥讯颊f不知道這回事,農(nóng)村里的小伙伴可能會(huì)知道)。 往年的國(guó)慶 還記得初中那會(huì)還和家里人一起上山采摘過,不過...

    0xE7A38A 評(píng)論0 收藏0
  • 國(guó)慶看了長(zhǎng)津湖 | 堅(jiān)韌的毅力讓我拿到了薪資18.5K,人生就像馬拉松,堅(jiān)持到最后,就是勝利者

    摘要:戰(zhàn)爭(zhēng)已勝,精神依在,當(dāng)延續(xù)了這份堅(jiān)韌與毅力之后,所有事情都將變得有無限可能,本期成功就業(yè)的小余,正是憑借著這股毅力,完成了夢(mèng)想,取得了高薪。 伴隨著7天國(guó)慶長(zhǎng)假落...

    smallStone 評(píng)論0 收藏0
  • 國(guó)慶假期學(xué)門新技術(shù),拒絕只做crud boy, 就從操作系統(tǒng)開始(三)

    摘要:因?yàn)椴僮飨到y(tǒng)一直被看做是計(jì)算機(jī)軟件的基石。本系列是我學(xué)習(xí)操作系統(tǒng)的筆記,操作系統(tǒng)是以為例子。其他的操作系統(tǒng)也是差不多。將設(shè)備驅(qū)動(dòng)一共分為個(gè)級(jí)別,每個(gè)級(jí)別的驅(qū)動(dòng)初始化聲明宏定義及其在系統(tǒng)啟動(dòng)過程中的啟動(dòng)順序如下表所示。 老板說我技術(shù)需要有長(zhǎng)進(jìn),不能只做一個(gè)crud boy。 于是我選來選去,...

    Hegel_Gu 評(píng)論0 收藏0
  • 我的秋招復(fù)盤——回顧2022秋招經(jīng)歷

    摘要:接下來,我主要從三個(gè)階段回顧我的秋招,分別是前期中期尾聲。到了這里,我的秋招算是正式的塵埃落定了,簽完三方后,我的秋招結(jié)束了。四復(fù)盤總結(jié)這次的復(fù)盤主要是我自己整個(gè)秋招的歷程縮影,很多細(xì)節(jié)無法在一篇文章就說清楚。 ...

    longshengwang 評(píng)論0 收藏0
  • 程序人生】?階段總結(jié)?-芝草無根

    ?階段一:回顧過往 ? ? ? ? 好久沒有更新博客了?(鴿了太久),嘿嘿,感覺是時(shí)候回過頭來寫一篇了...... ? ? ? ? 主要是因?yàn)閲?guó)慶假期快過去了,才發(fā)現(xiàn)自己好像什么事都沒有開始做。確實(shí)深有體會(huì):人越長(zhǎng)大,時(shí)間過得越快,當(dāng)下的我就處在時(shí)間飛逝的浮光掠影之中...... ? ? ? ? 后端的基礎(chǔ)經(jīng)過一年多的不斷學(xué)習(xí),漸漸進(jìn)入了尾聲...終于在國(guó)慶不久前進(jìn)入了分布式、SpingCloud...

    darryrzhong 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<