Advertisement
Guest User

Untitled

a guest
Mar 10th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. import tkinter
  2.  
  3. myGUI = tkinter.Tk()#Creates the Graphical User Interface
  4. myGUI.title("Gym Application Project") #Assigns title for APP
  5. myGUI.geometry("300x300") #Assigns the width and and length
  6. myGUI.configure(background="#a1dbcd")
  7.  
  8. #Creating a Login System
  9. # Username
  10. label = tkinter.Label(myGUI, text="Username:", background="#a1dbcd")# Creates a label called 'username'
  11. enter = tkinter.Entry(myGUI, textvariable=())
  12. # Password
  13. labelTWO = tkinter.Label(myGUI, text="Password:", background="#a1dbcd")
  14. enterTWO = tkinter.Entry(myGUI, show='*', textvariable=()) # the 'show='x' ' hides the password at input.
  15.  
  16. def valid():
  17. usernameValidity=enter.get()
  18. passwordValidity=enterTWO.get()
  19. if (usernameValidity=='admin') and (passwordValidity=='computing'):
  20. print ('You have succesfully logged in!')
  21. else:
  22. print ('Something appears to be wrong!')
  23.  
  24. # Login Button
  25. 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.
  26.  
  27. #Pack(adds) widgets to the window
  28. label.pack()
  29. enter.pack()
  30. labelTWO.pack()
  31. enterTWO.pack()
  32. button.pack()
  33. #
  34.  
  35. myGUI.mainloop()#runs the application and must be at the end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement