Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from guizero import App, TextBox, PushButton, Text, info
- app = App()
- # Function definitions for your events go here.
- def btn_go_clicked():
- info("Greetings","Your name is " + txt1_name.value + " - and you like " + animal_name.value)
- def btn_fun_clicked():
- info("Greetings","Your name is " + txt1_name.value + " - and you hate " + animal2_name.value)
- # Your GUI widgets go here
- lbl_name = Text(app, text="Hello. What's your name?")
- txt1_name = TextBox(app)
- lbl2_name =Text(app, text="Hello. which animal do you like the best?")
- animal_name =TextBox(app)
- btn_go = PushButton(app, command=btn_go_clicked, text="Done")
- lbl3_name =Text(app, text="Hello. What animal do you hate the most?")
- animal2_name =TextBox(app)
- btn_fun = PushButton(app, command=btn_fun_clicked, text="fun")
- # Show the GUI on the screen
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement