JAWarr

Password GUI code

Aug 13th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. # Import the GUI widgets that you'll be using, and create the 'app' for your program.
  2. from guizero import App, TextBox, PushButton, Text, info
  3. app = App()
  4.  
  5. # Function definitions for access granted and denied.
  6. def btn_go_clicked():
  7. if txt1_name.value == txt2_name.value:
  8. info("Password","Access Granted")
  9. else:
  10. info("Password","Access Denied")
  11.  
  12. # GUI widgets 2 labels and 2 text boxes
  13. lbl1_name = Text(app, text="Please enter the password")
  14. txt1_name = TextBox(app)
  15. lbl2_name = Text(app, text="Please re-enter the password")
  16. txt2_name = TextBox(app)
  17. btn_go = PushButton(app, command=btn_go_clicked, text="Enter")
  18.  
  19. # Show the GUI on the screen
  20. app.display()
  21.  
Add Comment
Please, Sign In to add comment