johnpentyrch

Gui2a

May 6th, 2020
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 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 your events go here.
  6. def btn_go_clicked():
  7.     if txt_passwd.value == txt2_passwd.value :
  8.         info("Password Match","Your password " + txt_passwd.value + ' is OK')
  9.     else:
  10.         info('no match', 'Passwords do not match')
  11.  
  12.  
  13. # Your GUI widgets go here
  14. lbl_passwd = Text(app, text="Enter your password")
  15. txt_passwd = TextBox(app)
  16. lbl2_passwd = Text(app, text="renter your password")
  17. txt2_passwd = TextBox(app)
  18. btn_go = PushButton(app, command=btn_go_clicked, text="Submit Password")
  19.  
  20. # Show the GUI on the screen
  21. app.display()
Add Comment
Please, Sign In to add comment