Advertisement
scipiguy

GUIZero - Password Checking

Oct 28th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. from guizero import App, TextBox, PushButton, Text, info
  2. app = App()
  3.  
  4. def btn_go_clicked():
  5.     info("Greetings","Hello, " + txt_name.value + " - Use this form to enter a password and confirm it")
  6.    
  7. def btn_check_clicked():
  8.     if txt_password_1.value == txt_password_2.value:
  9.         info("Confirmation", "Match!")
  10.     else:
  11.         info("Confirmation", "No match!")
  12.  
  13. lbl_name = Text(app, text="Hello. What's your name?")
  14. txt_name = TextBox(app)
  15.  
  16. lbl_password_1 = Text(app, text="\nEnter your password to the electronic cookie jar")
  17. txt_password_1 = TextBox(app)
  18. lbl_password_2 = Text(app, text="Enter your password to the electronic cookie jar again to confirm")
  19. txt_password_2 = TextBox(app)
  20.  
  21. btn_go = PushButton(app, command=btn_go_clicked, text="Done")
  22.  
  23. btn_check = PushButton(app, command=btn_check_clicked, text="Check passwords match")
  24.  
  25. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement