Skip to content
Permalink
Browse files

created a simple clock widget using Tkinter

  • Loading branch information
kiranonline committed Oct 13, 2019
1 parent cd3b802 commit d19d3422aabff4671d15fedb171b96da4eee7fc7
Showing with 33 additions and 0 deletions.
  1. +9 −0 UI-Apps/README.md
  2. +24 −0 UI-Apps/clock.py
@@ -0,0 +1,9 @@
### SIMPLE CLOCK WIDGET USING TKINTER

## Running instruction

# windows user
run `py clock.py`

# linux user
run `python3 clock.py`
@@ -0,0 +1,24 @@
import tkinter
# retrieve system's time
from time import strftime
#------------------main code-----------------------
#initializing the main UI object
top = tkinter.Tk()
#setting title of the App
top.title('Clock')
#restricting the resizable property
top.resizable(0,0)

def time():
string = strftime('%H:%M:%S %p')
clockTime.config(text = string)
clockTime.after(1000, time)


clockTime = tkinter.Label(top, font = ('calibri', 40, 'bold'), background = 'black', foreground = 'white')

clockTime.pack(anchor = 'center')
time()


top.mainloop()

0 comments on commit d19d342

Please sign in to comment.
You can’t perform that action at this time.