Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter
- myGUI = tkinter.Tk()#Creates the Graphical User Interface
- myGUI.title("Gym Application Project") #Assigns title for APP
- myGUI.geometry("300x300") #Assigns the width and and length
- myGUI.configure(background="#a1dbcd")
- #Creating a Login System
- # Username
- label = tkinter.Label(myGUI, text="Username:", background="#a1dbcd")# Creates a label called 'username'
- enter = tkinter.Entry(myGUI, textvariable=())
- # Password
- labelTWO = tkinter.Label(myGUI, text="Password:", background="#a1dbcd")
- enterTWO = tkinter.Entry(myGUI, show='*', textvariable=()) # the 'show='x' ' hides the password at input.
- def valid():
- usernameValidity=enter.get()
- passwordValidity=enterTWO.get()
- if (usernameValidity=='admin') and (passwordValidity=='computing'):
- print ('You have succesfully logged in!')
- else:
- print ('Something appears to be wrong!')
- # Login Button
- button = tkinter.Button(myGUI, command=valid, text="Login", fg="#a1dbcd", bg="#383a39") #at command=valid refers back to the def valid program if 'login' button clicked.
- #Pack(adds) widgets to the window
- label.pack()
- enter.pack()
- labelTWO.pack()
- enterTWO.pack()
- button.pack()
- #
- myGUI.mainloop()#runs the application and must be at the end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement