SHARE
TWEET

Password Check

SkinnyRedCarrot Jan 24th, 2020 (edited) 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top