-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanime_timer.py
More file actions
27 lines (23 loc) · 775 Bytes
/
anime_timer.py
File metadata and controls
27 lines (23 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
##############################################################################
# The program do not nothing special, only show timer
##############################################################################
import tkinter
from datetime import datetime
#init
##########################################
width,height = 400,200
canvas = tkinter.Canvas(width=width, height=height)
canvas.pack()
timer = canvas.create_text(width/2, height/2, text="", font='Helvetica 20')
size = 10
def clock():
global size
size = size + 2
font = 'Helvetica {}'.format(size)
time = datetime.utcnow().strftime('%H:%M:%S.%f')[:-5]
canvas.itemconfig(timer, text= time,font= font)
if size == 40:
size = 10
canvas.after(100, clock)
clock()
canvas.mainloop()