-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
52 lines (35 loc) · 1.48 KB
/
app.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from tkinter import *
class Application:
def __init__(self, master):
self.master = master
self.sequence_number = ""
self.new_sequence_number = ""
self.is_fullscreen = False
self.master.attributes("-fullscreen", True)
self.heading = Label(master, text="Numarator", font=('arial 60 bold'), fg='green')
self.heading.place(x=350, y=0)
self.n = Label(master, text="", font=('arial 300 bold'))
self.n.place(x=600, y=100)
self.pname = Label(master, text="", font=('arial 160 bold'))
self.pname.place(x=300, y=600)
master.bind("<Key>", self.key_pressed)
def key_pressed(self, event):
#print(event.keycode)
if event.keycode > 0 and event.keycode < 20:
self.new_sequence_number = f"{self.new_sequence_number}{event.char}"
if event.keycode == 36:
self.pname.config(text=self.sequence_number)
self.sequence_number = self.new_sequence_number
self.n.config(text=self.sequence_number)
self.new_sequence_number = ""
if event.keycode == 24:
self.master.quit()
root = Tk()
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
app = Application(root)
root.attributes('-zoomed', True)
root.attributes("-fullscreen", True)
root.geometry(f"{screen_width}x{screen_height}+0+0")
root.resizable(False, False)
root.mainloop()