Advertisement
Buzzbow

question

Aug 16th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. from guizero import App, TextBox, PushButton, Text, info
  2.  
  3. app = App()
  4.  
  5. # Function definitions for your events go here
  6. def btn_go_clicked():
  7. info("Greetings", "Hello, " + txt_name.value + " Your favourite animal is " + txt2_name.value)
  8.  
  9.  
  10. def btn_iceCream_clicked():
  11. info("ice_cream", "so " + txt_name.value + "Does your " + txt2_name.value + "eat Ice-cream")
  12.  
  13. # Your GUI widgets go here
  14. lbl_name = Text(app, text="Hello. What's your name?")
  15. txt_name = TextBox(app)
  16.  
  17. lbl2_name = Text(app, text=" What is you favourite animal?")
  18. txt2_name = TextBox(app)
  19.  
  20. btn_go = PushButton(app, command=btn_go_clicked, text="Done")
  21. btn_iceCream = PushButton(app, command=btn_iceCream_clicked, text="Submit")
  22.  
  23.  
  24.  
  25.  
  26. # Show the GUI on the screen
  27. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement