Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Create a new app that asks a user to enter a password twice
- # and then tells them whether they entered it the same both times.
- from guizero import App, TextBox, PushButton, Text, info
- app = App("Password Checker")
- def check_password_validity(x,y):
- if x == y:
- info("Success", "Your password entries match!")
- else:
- info("Unsuccessful", "Sorry, your passwords do not match!")
- lbl_pw1 = Text(app,"Please enter your new password:")
- txt_pw1 = TextBox(app)
- lbl_pw2 = Text(app, "Please reenter your password:")
- txt_pw2 = TextBox(app)
- btn_check = PushButton(app, command=check_password_validity(txt_pw1.value, txt_pw2.value), text="Check")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement