Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import the GUI widgets that you'll be using, and create the 'app' for your program.
- from guizero import App, TextBox, PushButton, Text, info,error
- app = App()
- # Function definitions for your events go here.
- def btn_go_clicked():
- if first_password.value == second_password.value:
- info("Greetings","your password is " + first_password.value )
- else:
- error("Greetings","Please; enter the same password. Please,try again")
- def highlight():
- first_password.bg = "light blue"
- second_password.bg = "light green"
- def lowlight():
- first_password.bg = None
- second_password.bg = None
- # Your GUI widgets go here
- q1_password = Text(app, text="Please; enter your password")
- first_password = TextBox(app)
- first_password.when_mouse_enters = highlight
- first_password.when_mouse_leaves = lowlight
- q2_password= Text(app, text="Enter once again your password")
- second_password = TextBox(app)
- second_password.when_mouse_enters = highlight
- second_password.when_mouse_leaves = lowlight
- btn_go = PushButton(app, command=btn_go_clicked, text="Done")
- # Show the GUI on the screen
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement