Advertisement
Guest User

Untitled

a guest
Dec 7th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1.     usernameEntry = tk.Entry(self)
  2.         passwordEntry = tk.Entry(self, show="*")
  3.         usernameLabel = tk.Label(self, text="Username").pack()
  4.         usernameEntry.pack()
  5.         pas1swordLabel = tk.Label(self, text="Password").pack()
  6.         passwordEntry.pack()
  7.  
  8.         def login_btn_clicked():
  9.             #print("Clicked")
  10.             username = usernameEntry.get()
  11.             password = passwordEntry.get()
  12.            
  13.             if username == "leeman" and password == "password":
  14.                 print("Done Auth")
  15.                 controller.show_frame(menu)
  16.             elif self.failedLogins >= 3:
  17.                 messagebox.showerror("Login failed", "Too many incorrect login attempts")
  18.             else:
  19.                 self.failedLogins+=1
  20.        
  21.         button = tk.Button(self, text="Login", command=login_btn_clicked)
  22.         button.pack()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement