Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter
- myGUI = tkinter.Tk()
- myGUI.title("Gym Application Project")
- myGUI.geometry("500x300")
- myGUI.config(bg="#a1dbcd")
- myGUI.resizable(width=False, height=False)
- UserName = tkinter.Label(myGUI,
- text="Username",
- bg="#a1dbcd",
- font=15)
- UserName.pack()
- UserName.place(x=10,y=20)
- UserName_Entry = tkinter.Entry(myGUI,
- fg="black",
- relief="groove",
- width=25,
- font=("verdana",10),
- highlightthickness=1,
- highlightbackground="black",
- textvariable=())
- UserName_Entry.pack()
- UserName_Entry.place(x=10,y=40)
- Password = tkinter.Label(myGUI,
- text="Password",
- bg="#a1dbcd",
- font=15)
- Password.pack()
- Password.place(x=10,y=80)
- Password_Entry = tkinter.Entry(myGUI,
- fg="black",
- show='*',
- relief="groove",
- width=25,
- font=("verdana",10),
- highlightthickness=1,
- highlightbackground="black",
- textvariable=())
- Password_Entry.pack()
- Password_Entry.place(x=10,y=100)
- def Is_Valid():
- UsernameValidity=UserName_Entry.get()
- PasswordValidity=Password_Entry.get()
- if (UsernameValidity=='admin') and (PasswordValidity=='computing'):
- print (" One of the accounts has successfully logged in ")
- PasswordWrongText.config(text=" You have logged in! ", fg="black", highlightthickness=1)
- else:
- print (" One of the accounts inputted the wrong credentials! ")
- PasswordWrongText.config(text=" Invalid username or Password! ", fg="black", highlightthickness=1)
- def Close_Application():
- myGUI.destroy()
- exit()
- PasswordWrongText = tkinter.Label(myGUI,
- font=("verdana", 10),
- bg="#a1dbcd")
- PasswordWrongText.place(x=10,y=140)
- Login_Button = tkinter.Button(myGUI,
- text="Login",
- bg="snow",
- relief="sunken",
- width=20,
- font=("verdana", 10),
- highlightthickness=2,
- command=Is_Valid)
- Login_Button.pack()
- Login_Button.place(x=10, y=260)
- Exit_Button = tkinter.Button(myGUI,
- text="Exit",
- bg="snow",
- relief="sunken",
- width=20,
- font=("verdana", 10),
- highlightthickness=2,
- command=Close_Application)
- Exit_Button.pack()
- Exit_Button.place(x=320,y=260)
- myGUI.mainloop()
Add Comment
Please, Sign In to add comment