-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEntry_Box.py
50 lines (41 loc) · 948 Bytes
/
Entry_Box.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 *
def submit():
username = entry.get()
print(f"Hello {username}")
entry.config(state = DISABLED) # DIsable after submission
def clear():
entry.delete(0, END)
def backspace():
entry.delete(len(entry.get()) - 1, END)
window = Tk()
entry = Entry(
window,
font=("Arial", 50),
fg = "white",
bg = "black",
show = "#" # Only allowed character to be shown
)
entry.insert(0, "Skibidi") # Default text in the entry box
entry.pack(side = LEFT)
submit_button = Button(
window,
text = "Submit",
font = ("Verdana", 25),
command = submit
)
submit_button.pack(side = RIGHT)
clear_button = Button(
window,
text = "X",
font = ("Verdana", 25),
command = clear
)
clear_button.pack(side = RIGHT)
backspace_button = Button(
window,
text = "<--",
font = ("Verdana", 25),
command = backspace
)
backspace_button.pack(side = RIGHT)
window.mainloop()