Python clock program 🕒

Поделиться
HTML-код
  • Опубликовано: 15 сен 2020
  • Python clock program app tutorial for beginners
    #Python #clock #program #app #code #GUI #tkinter #tutorial
    from tkinter import *
    from time import *
    def update():
    time_string = strftime("%I:%M:%S %p")
    time_label.config(text=time_string)
    day_string = strftime("%A")
    day_label.config(text=day_string)
    date_string = strftime("%B %d, %Y")
    date_label.config(text=date_string)
    window.after(1000,update)
    window = Tk()
    time_label = Label(window,font=("Arial",50),fg="#00FF00",bg="black")
    time_label.pack()
    day_label = Label(window,font=("Ink Free",25,"bold"))
    day_label.pack()
    date_label = Label(window,font=("Ink Free",30))
    date_label.pack()
    update()
    window.mainloop()
  • НаукаНаука

Комментарии • 60

  • @BroCodez
    @BroCodez  3 года назад +25

    from tkinter import *
    from time import *
    def update():
    time_string = strftime("%I:%M:%S %p")
    time_label.config(text=time_string)
    day_string = strftime("%A")
    day_label.config(text=day_string)
    date_string = strftime("%B %d, %Y")
    date_label.config(text=date_string)
    window.after(1000,update)
    window = Tk()
    time_label = Label(window,font=("Arial",50),fg="#00FF00",bg="black")
    time_label.pack()
    day_label = Label(window,font=("Ink Free",25,"bold"))
    day_label.pack()
    date_label = Label(window,font=("Ink Free",30))
    date_label.pack()
    update()
    window.mainloop()

  • @lanzeavellanoza7207
    @lanzeavellanoza7207 6 дней назад

    Fantastic

  • @TheLoneMan-fk2iu
    @TheLoneMan-fk2iu 2 месяца назад

    You Sir is one of a life saver, Currently I'm developing a solo project of AlertAnnouncement/Schedule for schools and I'm struggling for a RTC concept code and this just saved my butt for weeks. Thanks for exsisting!

  • @hilaryeins1
    @hilaryeins1 3 года назад +3

    Thank you very much my friend for sharing your precious knowledge with us. You really know how to get us into coding...
    There is no more world to thank you...

  • @kailen0502
    @kailen0502 Месяц назад

    hiii! i really enjoyed this video, thank you for explaining everything so well :)

  • @sujauddin1
    @sujauddin1 Год назад

    Hay you I’m taking to you. Really I like your video. I commented , liked and subscribed. Thank you.

  • @jhassee
    @jhassee Год назад

    This is an especially cool one, it makes you feel as if you've done something!

  • @scienceclassviiscienceixch1653
    @scienceclassviiscienceixch1653 9 месяцев назад

    Excellent 🎉

  • @kapibara2440
    @kapibara2440 6 месяцев назад

    Fantastic 🎉🎉🎉🎉

  • @Kaushik129
    @Kaushik129 4 месяца назад

    Excellent 👌

  • @yoober387
    @yoober387 Год назад

    thank you so much for uploading this video

  • @harrisonphiri2837
    @harrisonphiri2837 Год назад

    Nice work!

  • @itz_darkvoid
    @itz_darkvoid 6 месяцев назад

    Great tutorial!

  • @ricodexr
    @ricodexr 2 года назад +1

    very thanks, it is useful 👍

  • @sktech6003
    @sktech6003 Год назад +1

    excellent tutorial man!

  • @MadhukaHiranya
    @MadhukaHiranya 4 месяца назад +1

    Superb Bro

  • @MK-vd4yx
    @MK-vd4yx 2 года назад

    Nice.

  • @tread2114
    @tread2114 Год назад

    Great vid!

  • @dineshgautam7027
    @dineshgautam7027 2 года назад

    And thanks for sparing time for us....

  • @vikassoni9133
    @vikassoni9133 2 года назад

    Good

  • @youlgensvixamar127
    @youlgensvixamar127 Год назад

    good

  • @dineshgautam7027
    @dineshgautam7027 2 года назад

    Bro you r great...

  • @matheusgirardiscalabrin5651
    @matheusgirardiscalabrin5651 3 года назад

    gr8

  • @chingizxonislomov6618
    @chingizxonislomov6618 Год назад

    Thank you so very much😀😃😄

  • @RARYAMEHD
    @RARYAMEHD 10 месяцев назад

    thank you for dis bro

  • @shahzodsayfiddinov9510
    @shahzodsayfiddinov9510 3 года назад

    Thank you Bro!

  • @IbrahimBratan
    @IbrahimBratan Месяц назад

    Thanks

  • @Lesnoe4mo
    @Lesnoe4mo 2 года назад +3

    Hey Dude, you really do make videos at 6:46 in the morning? :)
    And thank you for your great content!

    • @ricardonieto5337
      @ricardonieto5337 Год назад

      most probable he was working all night and finished that day at that time, it happens when you are passionate about your job

  • @sassunny555
    @sassunny555 16 дней назад

    Re-watching this while making a To do list app project

  • @shybitiwa
    @shybitiwa 2 года назад

    how can u do multiple languages at once.....u realy inspired me

  • @znkhwskh
    @znkhwskh 2 года назад

    bro how does it toke from you to learn all this (Java , C++ , C , JavaScript , Python )

  • @noaholesen297
    @noaholesen297 2 года назад

    thx

  • @NOTHING-en2ue
    @NOTHING-en2ue Год назад

    Thanks man

  • @UCBerkeley6272
    @UCBerkeley6272 Год назад +1

    i want to learn how to do python coding made simple

  • @slonbeskonechen8310
    @slonbeskonechen8310 3 года назад

    F@ck! It seems it's what I looking for! Thank you!

  • @alexalexander1471
    @alexalexander1471 10 месяцев назад

    from tkinter import *
    from time import *
    def update():
    time_string = strftime("%I%M%S"")
    time_label.cfig(text=time_string)
    window = Tk()
    time_label = Label(window,font=("Arial",50),fg="#00FF00",bg="black")
    time_labe.pack()
    update()
    window.mainllop()

  • @davidmcdade9951
    @davidmcdade9951 3 года назад +1

    Thanks!

    • @BroCodez
      @BroCodez  3 года назад +2

      thanks for watching David

  • @phungduyquang9498
    @phungduyquang9498 2 года назад

    I have an error in line 14, help me!

  • @emenaloui917
    @emenaloui917 2 года назад

    how can i change the time to 7:77:77 pls i m not crazy or smth i need it xd and ty

  • @KapilGoyal-wz2in
    @KapilGoyal-wz2in 11 месяцев назад

    I tried this code but seconds is not updating

  • @thequeenofspades
    @thequeenofspades 5 месяцев назад

    Won't all that recursion cause a call stack overflow?

    • @davidhirschhorn2960
      @davidhirschhorn2960 3 месяца назад

      From a stackoverflow answer to this: after works differently, and is not recursion.
      The call to after writes to a todo list that the main program needs to call update(). Then this run of update completes and the flow goes back to the main program. then a second later the main program calls update again.

  • @onlyLewds
    @onlyLewds 2 года назад +1

    whats the difference between from time import * and import time?

    • @Wock__
      @Wock__ Год назад +4

      from time import * imports everything from the time namespace directly into the current namespace.
      e.g.
      import time
      time.sleep(1)
      vs
      from time import *
      sleep(1)
      Generally it's bad practice to import * as you have no idea what you're importing and it could end up in name clashes.
      It's best to do
      from time import sleep
      or
      import time
      and if you end up with a name clash you can do
      from time import sleep as standard_sleep
      standard_sleep(1)
      This applies to any Python package.

    • @JustCoding.
      @JustCoding. 5 месяцев назад +1

      tysm@@Wock__

  • @habibullohziyoyev7136
    @habibullohziyoyev7136 Год назад

    a comment like u told 😅

  • @SlayebePlayz666
    @SlayebePlayz666 2 года назад

    It isn't working.

  • @MilanKarakas
    @MilanKarakas 3 года назад

    I rather prefer to call symbol '%' as mode or modulo, rather than 'percentage'.

  • @santiagovidal4497
    @santiagovidal4497 2 года назад

    who watched this on a wednesday? edit: not only is it a wednesday... it is september 1st... almost one year anniversary, crazy...

  • @AshokMishra-xh4wv
    @AshokMishra-xh4wv Год назад

    from tkinter import *
    from time import strftime
    root = Tk()
    root.title("Menu")
    def open():
    top = Toplevel()
    top.title("Date")
    my_label = Label(top,text = strftime("%I:%M:%S %p"), font="ds-digital",bg="black",fg="cyan" )

    my_label.after(1000,open)
    my_label.pack()

    btn = Button(root, text="clock", command=open)
    btn.pack()
    mainloop()
    can anyone solve this why evert time new window of clock opens

    • @Don_Zaloog
      @Don_Zaloog 8 месяцев назад

      cause you execute the open function every 1000ms, which generates a new label

  • @arpanshah355
    @arpanshah355 11 месяцев назад

    comment

  • @derpfisti2457
    @derpfisti2457 Год назад

    step 3 = done
    step 1 = done 👍
    step 2 = done 🗯
    thx very much Bro, really helps! Keep on going!

  • @sktech6003
    @sktech6003 Год назад

    excellent tutorial man!