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
- app = App()
- # Function definitions for your events go here.
- def btn_go_clicked():
- info("","Your name is " + txt_name.value + " and you like "+ txt_animal.value + ".")
- def btn_go2_clicked():
- info("","Your name is " + txt_name.value + ". You like "+ txt_animal.value +", but you dislike " + txt_animaldis.value + ".")
- # Your GUI widgets go here
- lbl_name = Text(app, text="What's your name?")
- txt_name = TextBox(app)
- lbl_animal = Text(app, text=" What animals do you like the most?")
- txt_animal = TextBox(app)
- btn_go = PushButton(app, command=btn_go_clicked, text="Done")
- lbl_animaldis = Text(app, text=" What animals do you dislike the most?")
- txt_animaldis = TextBox(app)
- btn_go2 = PushButton(app, command=btn_go2_clicked, text="Add information")
- # Show the GUI on the screen
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement