istvanrefle

Untitled

Dec 10th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 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.  
  4. app = App(layout="grid")
  5.  
  6. # Function definitions for your events go here.
  7. def btn_checkPassword_clicked():
  8. if txt_user == "" :
  9. if txt_password1 == txt_password2 :
  10. info("Password Check", "Your passwords match!")
  11. else :
  12. info("Password Check", "Your passwords unmatch!")
  13. else :
  14. info("Password Check", "Pls fill username!")
  15.  
  16.  
  17. # Your GUI widgets go here
  18. lbl_user = Text(app, text="username:", grid=[0,0], align="left")
  19. txt_user = TextBox(app, width=20, grid=[1,0])
  20. lbl_password = Text(app, text="password:", grid=[0,1], align="left")
  21. txt_password1 = TextBox(app, text="enter password", width=20, grid=[1,1])
  22. txt_password2 = TextBox(app, text="re-enter password", width=20, grid=[1,2])
  23. btn_checkPassword = PushButton(app, command=btn_checkPassword_clicked, text="Done", grid=[1,3], align="left")
  24.  
  25. # Show the GUI on the screen
  26. app.display() # Write your code here :-)
Advertisement
Add Comment
Please, Sign In to add comment