Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. class MainMenu(tk.Frame):
  2.  
  3. def __init__(self, parent, controller):
  4. tk.Frame.__init__(self, parent)
  5. self.controller = controller
  6. label = tk.Label(self, text=" Main Menu - Login ", fg="red", font=controller.title_font2)
  7. label.pack(side="top", fill="x", pady=20)
  8. usernameL = tk.Label(self, text="Username").pack(side="top")
  9. uUserLogin = tk.Entry(self)
  10. uUserLogin.pack()
  11. passwordL = tk.Label(self, text="Password").pack(side="top")
  12. uUserPassword = tk.Entry(self)
  13. uUserPassword.pack()
  14.  
  15. def checkUser():
  16. uLoginUser = False
  17. uLoginPassword = False
  18. uUserCheck = uUserLogin.get()
  19. uUserCheckP = uUserPassword.get()
  20. with open("Users.csv", "r") as f:
  21. csvreader = csv.reader(f, delimiter=",")
  22. for row in csvreader:
  23. if uUserCheck == row[0]:
  24. uLoginUser == True
  25. if uUserCheckP == row[1]:
  26. uLoginPassword == True
  27. #labelT = tk.Label(self, text="Hello")
  28. #labelT.pack()
  29. if uLoginUser and uLoginPassword == True:
  30. controller.show_frame("MainTMenu")
  31.  
  32. submit = tk.Button(self, text="Submit",
  33. command=checkUser())
  34. submit.pack()
  35.  
  36.  
  37. #If correct -> Go to next frame
  38.  
  39. Users, Passwords
  40. user, password
  41. user, password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement