Advertisement
SkinnyRedCarrot

Password Check

Jan 24th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. # Import the GUI widgets thay you'll be using, and create the 'app' for
  2. # your program.
  3. from guizero import App, TextBox, PushButton, Text, info
  4. app = App()
  5.  
  6. # Function definition for your events go here.
  7. def btn_go_clicked():
  8. info("Greetings", "The passwords " + \
  9. ("are empty!" \
  10. if len(txt_pwd1.value) == len(txt_pwd2.value) == 0 \
  11. else ("" if txt_pwd1.value == txt_pwd2.value else "don't ") + \
  12. "match"))
  13.  
  14. # Your GUI widgets go here
  15. lbl_pwd1 = Text(app, text = "Enter your password twice")
  16. txt_pwd1 = TextBox(app)
  17. txt_pwd2 = TextBox(app)
  18.  
  19. btn_go = PushButton(app, command = btn_go_clicked, text = "Done")
  20.  
  21. # Show the GUI on the screen
  22. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement