Skip to main content


Amazing Widget with Python | Onscreen digital clock | Desktop Widget with Python



from tkinter import *
from tkinter.ttk import *
from time import strftime

root = Tk()
root.title("Clock")

def dot():
     dots = [":"," "]
     seconds = strftime("%S")
     if (int(seconds) % 2) == 0:
        dt_1 = str(dots[0])
        return(dt_1)
     else:
        dt_2 = str(dots[1])
        return(dt_2)
     
def time():
     string = strftime("%I{0}%M{1}%S %p".format(dot(),dot()))
     label.config(text=string)
     label.after(1000,time)
#bg = #1B1E26
#fg = #FFE222
label = Label(root,font=("digital numbers",70), background = "#1B1E26", foreground="#FFE222")
label.pack(anchor="center")
label.master.overrideredirect(True)
label.master.geometry('+10+930')
#label.master.wm_attributes("-transparentcolor","#FFE221")
#label.master.wm_attributes("-alpha",0.5)
label.master.wm_attributes("-topmost",True)
label.master.lift()
time()

ws = root.winfo_screenwidth()
hs = root.winfo_screenheight()
print(ws,'x', hs)    
mainloop()

Comments

  1. Hey Bro, Nice Content.....But how you add ide on website??

    ReplyDelete
  2. Haven't use my google plus account in so long, my profile pic is from that cringey DBZ movie

    ReplyDelete

Post a Comment



🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍

Popular Posts

Python underline string, Python underline text, Underline python print

Python pip - Installing modules from IDLE (Pyton GUI) for python 3.7

Top 40 Python - String Processing in Python | Working with String in Python

Python Program - When was I born? / Date of Birth / MY BIRTHDAY (using Python3+)

Top 11 Essential Python Tips and Tricks





Subscribe to our Channel


Follow us on Facebook Page

Join our python facebook groups



Join us on Telegram