-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGui tk.py
41 lines (35 loc) · 908 Bytes
/
Gui tk.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
#GUI #you can use pyqt or kivy
dic_credentials = {
'admin' : 'India123',
'Arvind' : '123456',
'Ravi' : 'ravi1234@',
'Atharva' : 'Atharva1234@',
}
def dosomething():
username = user_entry.get()
password = pwd_entry.get()
if dic_credentials[username] == password :
print("Login Succsess")
if
else:
print("Invalid Credentials")
import tkinter as tk #GUI
gui = tk.Tk()
gui.geometry('350x200')
#username lable
user_lable = tk.Label(master = gui ,text = "Username" )
#username entry
user_entry = tk.Entry(master = gui)
#Password Lable
pwd_lable = tk.Label(master = gui,text = "Password")
#Password Entry
pwd_entry = tk.Entry(master= gui,show ="*")
#button
btn_login = tk.Button(master= gui ,text= 'Login',command = dosomething) #link to function
#pack
user_lable.pack()
user_entry.pack()
pwd_lable.pack()
pwd_entry.pack()
btn_login.pack()
gui.mainloop()