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 pr$
- from guizero import App, TextBox, PushButton, Text, info
- from time import time, sleep
- app = App()
- # Function definitions for your events go here.
- def btn_go_clicked():
- info("Greetings","Hello, " + txt_name.value + " - I hope you're having $
- def btn_go_clicked2():
- info("Say hello","Your name is " + txt_name.value+"and you like "+ txt_$
- def btn_go_clicked3():
- if txt_name3.value==txt_name4.value:
- info("Checking","Your password is correct")
- else:
- info("Checking","Your password does not match. Try again.")
- txt_name3.clear()
- txt_name4.clear()
- # Your GUI widgets go here
- lbl_name = Text(app, text="Hello. What's your name?")
- txt_name = TextBox(app)
- lbl_name2 = Text(app, text="What's your favorite pet")
- txt_name2= TextBox(app)
- btn_go = PushButton(app, command=btn_go_clicked, text="Done")
- btn_go2=PushButton(app, command=btn_go_clicked2, text="Say")
- lbl_name3= Text(app, text="Write your passwrod in the boxes below")
- txt_name3=TextBox(app)
- txt_name4=TextBox(app)
- btn_go3=PushButton(app, command=btn_go_clicked3, text="Check")
- # Show the GUI on the screen
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement