Created
April 3, 2022 16:48
-
-
Save SmashedFrenzy16/a02dbeca7c7840ce237ce32a37cf434e to your computer and use it in GitHub Desktop.
A digital clock in Python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import strftime | |
import tkinter | |
from tkinter import Tk | |
root = Tk() | |
root.title("Digital Clock") | |
root.geometry("235x60") | |
clock = tkinter.Label(root, fg="black", font=("Arial", 30, 'bold')) | |
clock.place(x=0, y=0) | |
def digital_clock(): | |
time = strftime('%H: %M: %S') | |
clock.configure(text=time) | |
clock.after(1000, digital_clock) | |
digital_clock() | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment