Advertisement
Mori007

myassigment02

Feb 1st, 2021
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. from guizero import App, Text, TextBox, PushButton, info
  2.  
  3. app = App(title='Login')
  4.  
  5. # Function of comparing the password
  6. def compared_pass():
  7. if txt_pass1.value == txt_pass2.value:
  8. info("Password", "Your password is right " + txt_user.value + " OK...")
  9. else:
  10. info("Password", "Please check again... Password is wrong.. ")
  11.  
  12. # GUI Widget
  13. lb_user = Text(app, text='Enter username')
  14. txt_user = TextBox(app)
  15.  
  16. lb_pass1 = Text(app, text='Enter your password')
  17. txt_pass1 = TextBox(app)
  18.  
  19. lb_pass2 = Text(app, text='Please enter your password again')
  20. txt_pass2 = TextBox(app)
  21.  
  22. btn_compared = PushButton(app, command=compared_pass, text='Compared')
  23.  
  24. # Display on screen
  25. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement