Let's code a CLOCK PROGRAM in python! 🕒

Поделиться
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()
  • НаукаНаука

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

  • @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()

  • @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...

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

    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!

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

    Nice work!

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

    excellent tutorial man!

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

    very thanks, it is useful 👍

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

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

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

    Great tutorial!

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

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

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

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

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

    Great vid!

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

    Superb Bro

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

    thank you so much for uploading this video

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

    Fantastic

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

    Fantastic 🎉🎉🎉🎉

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

    Excellent 🎉

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

    Bro you r great...

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

    Excellent 👌

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

    Nice.

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

    And thanks for sparing time for us....

  • @kavindudilshan2713
    @kavindudilshan2713 7 дней назад

    good part

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

    Thank you so very much😀😃😄

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

    Thank you Bro!

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

    thank you for dis bro

  • @IbrahimBratan
    @IbrahimBratan 2 месяца назад

    Thanks

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

    Thanks man

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

    Thanks!

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

      thanks for watching David

  • @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

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

    thx

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

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

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

    Good

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

    gr8

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

    i want to learn how to do python coding made simple

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

    good

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

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

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

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

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

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

  • @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

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

    I have an error in line 14, help me!

  • @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. 6 месяцев назад +1

      tysm@@Wock__

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

    a comment like u told 😅

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

    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()

  • @KapilGoyal-wz2in
    @KapilGoyal-wz2in Год назад

    I tried this code but seconds is not updating

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

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

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

      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.

  • @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...

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

    It isn't working.

  • @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 9 месяцев назад

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

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

    comment

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

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

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

    excellent tutorial man!