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
- def btn_name_clicked():
- info("Greetings", "Hello, " + txt_name.value + " - I hope you\'re having a nice day")
- def btn_flavour_clicked():
- info("Flavour Confirmation", "I understand that your favourite icr cream flavour is " + txt_flavour.value + "!")
- #GUI
- lbl_name = Text(app, text="Hello. What's your name?")
- txt_name = TextBox(app)
- btn_go = PushButton(app, command=btn_name_clicked, text="Done")
- lbl_flavour = Text(app, text = "Your favourite ice cream flavour?")
- txt_flavour = TextBox(app)
- btn_flavour = PushButton(app, command=btn_flavour_clicked, text="Confirm flavour")
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement