Advertisement
mrFitzpatrick

passwordGUIusingIF

Jul 30th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. #Create a new app that asks a user to enter a password twice
  2. # and then tells them whether they entered it the same both times.
  3.  
  4. from guizero import App, TextBox, PushButton, Text, info
  5. app = App("Password Checker")
  6.  
  7. def check_password_validity(x,y):
  8.     if x == y:
  9.         info("Success", "Your password entries match!")
  10.     else:
  11.         info("Unsuccessful", "Sorry, your passwords do not match!")
  12.  
  13. lbl_pw1 = Text(app,"Please enter your new password:")
  14. txt_pw1 = TextBox(app)
  15.  
  16. lbl_pw2 = Text(app, "Please reenter your password:")
  17. txt_pw2 = TextBox(app)
  18.  
  19. btn_check = PushButton(app, command=check_password_validity(txt_pw1.value, txt_pw2.value), text="Check")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement