Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import datetime
- import turtle
- n =0
- now = datetime.datetime.today()
- now =str(now)
- print(now)
- length = len(now)
- seconds = now[length-9:length-7]
- seconds = int(seconds)
- minutes = now[length-12:length-10]
- minutes = int(minutes)
- hours = now [length-15:length-13]
- hours = int(hours)
- from turtle import *
- setup()
- t1 = Turtle()
- while True:
- t1.penup()
- t1.goto(-150,0)
- t1.pendown()
- t1.clear()
- t1.write(str(hours).zfill(2)+":"+str(minutes).zfill(2)+":"+str(seconds).zfill(2), font = ("arial",50))
- seconds = seconds +1
- n += 1
- time.sleep(1)
- if n % 30 == 0:
- now = datetime.datetime.today()
- now =str(now)
- print(now)
- length = len(now)
- seconds = now[length-9:length-7]
- seconds = int(seconds)
- if seconds == 60:
- seconds = 0
- minutes = minutes + 1
- if minutes == 60:
- minutes = 0
- hours = hours + 1
- if hours == 24:
- hours = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement