Advertisement
zhongnaomi

gui 4

Jan 1st, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. from guizero import App, TextBox, PushButton, Text, info
  2. app = App()
  3.  
  4. # Function definitions for your events go here.
  5. def btn_go_clicked():
  6.     info("Greetings","Your name is " + txt1_name.value + " - and you like  " + animal_name.value)
  7. def btn_fun_clicked():
  8.     info("Greetings","Your name is " + txt1_name.value + " - and you hate  " + animal2_name.value)
  9. # Your GUI widgets go here
  10. lbl_name = Text(app, text="Hello. What's your name?")
  11. txt1_name = TextBox(app)
  12. lbl2_name =Text(app, text="Hello. which animal do you like the best?")
  13. animal_name =TextBox(app)
  14. btn_go = PushButton(app, command=btn_go_clicked, text="Done")
  15. lbl3_name =Text(app, text="Hello. What animal do you hate the most?")
  16. animal2_name =TextBox(app)
  17. btn_fun = PushButton(app, command=btn_fun_clicked, text="fun")
  18.  
  19. # Show the GUI on the screen
  20. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement