Advertisement
Carlos-Quispe

mi segunda aplicacion GUI

Jan 27th, 2020
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. # import the GUI widgets taht you'll be using, and create the 'app' for your program.
  2. from guizero import App, TextBox, PushButton, Text, info
  3. app= App()
  4.  
  5. # Function definition for your eventws go here
  6. def btn_go_clicked():
  7.     info("Greetings","Your name is " + txt_name.value + " And you like " +txt_ani.value )
  8.    
  9. def btn_ot_clicked():
  10.     info("Greetings","Good Bye " + txt_name.value + " And you " +txt_ani.value )
  11. # Your GUI widgets go here
  12. lbl_name = Text(app,text="Hello. What's your name?")
  13. txt_name = TextBox(app)
  14. lbl_ani = Text(app,text="the name of an animal?")
  15. txt_ani = TextBox(app)
  16. btn_go = PushButton(app, command=btn_go_clicked, text="Done")
  17. btn_ot = PushButton(app, command=btn_ot_clicked, text="Done")
  18. #Show the GUI on the screen
  19. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement