# Python program to draw digital clock using Turtle
import time
import datetime as dte
import turtle
# Create a turtle to display time
t1 = turtle.Turtle()
# Create a turtle to create rectangle box
t2 = turtle.Turtle()
# Create screen
screen = turtle.Screen()
# Set background color of the screen
screen.bgcolor("orange")
# Obtain current hour, minute and second from the system
sec = dte.datetime.now().second
min = dte.datetime.now().minute
hr = dte.datetime.now().hour
t2.pensize(3)
t2.color('black')
t2.penup()
# Set the position of turtle
t2.goto(-5, 0)
t2.pendown()
# Create rectangular box
for i in range(2):
t2.forward(200)
t2.left(90)
t2.forward(70)
t2.left(90)
# Hide the turtle
t2.hideturtle()
while True:
t1.hideturtle()
t1.clear()
# Display the time
t1.write(str(hr).zfill(1)
+ ":"+str(min).zfill(1)+":"
+ str(sec).zfill(1),
font=("Arial Narrow", 35, "bold"))
time.sleep(1)
sec += 1
if sec == 60:
sec = 0
min += 1
if min == 60:
min = 0
hr += 1
if hr == 13:
hr = 1
Shailendra Bramhvanshi, Founder at Techaroha Solutions Private Limited and CEO at Newtum Solutions Private Limited. BlockChain Experts with 12 years of IT Experience in of all aspects of running Organization and Project Management. I have created different coins to help the business to bring more trust. Recently deployed a stable coin in India TrueINR and working on few cryptocurrency exchanges. My Team is being rated as a top 10 blockchain service provider in India by Silicon India