Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MainMenu(tk.Frame):
- def __init__(self, parent, controller):
- tk.Frame.__init__(self, parent)
- self.controller = controller
- label = tk.Label(self, text=" Main Menu - Login ", fg="red", font=controller.title_font2)
- label.pack(side="top", fill="x", pady=20)
- usernameL = tk.Label(self, text="Username").pack(side="top")
- uUserLogin = tk.Entry(self)
- uUserLogin.pack()
- passwordL = tk.Label(self, text="Password").pack(side="top")
- uUserPassword = tk.Entry(self)
- uUserPassword.pack()
- def checkUser():
- uLoginUser = False
- uLoginPassword = False
- uUserCheck = uUserLogin.get()
- uUserCheckP = uUserPassword.get()
- with open("Users.csv", "r") as f:
- csvreader = csv.reader(f, delimiter=",")
- for row in csvreader:
- if uUserCheck == row[0]:
- uLoginUser == True
- if uUserCheckP == row[1]:
- uLoginPassword == True
- #labelT = tk.Label(self, text="Hello")
- #labelT.pack()
- if uLoginUser and uLoginPassword == True:
- controller.show_frame("MainTMenu")
- submit = tk.Button(self, text="Submit",
- command=checkUser())
- submit.pack()
- #If correct -> Go to next frame
- Users, Passwords
- user, password
- user, password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement