-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry.py
More file actions
50 lines (38 loc) · 1.12 KB
/
entry.py
File metadata and controls
50 lines (38 loc) · 1.12 KB
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 *
# entry widge = textbox that accepts a single line of user input
window = Tk()
window.title("An entry case")
count = 0
def submit():
global count
count += 1
username = entry.get()
print("Hello,",username,"+",count)
def backspace():
entry.delete(len(entry.get())-1,END)
def delete():
entry.delete(0,END)
username_entry = Entry(window,
font = ("Arial",50),
fg="#00FF00",
bg="black")
username_entry.pack(side="left")
password_entry = Entry(window,
font = ("Arial",50),
fg="#00FF00",
bg="black",
show="*")
password_entry.pack(side="left")
submit_button = Button(window,
text="submit",
command=submit)
submit_button.pack(side="bottom")
backspace_button = Button(window,
text="backspace",
command=backspace)
backspace_button.pack(side="bottom")
delete_button = Button(window,
text="delete",
command=delete)
delete_button.pack(side="bottom")
window.mainloop()