xavicano

Untitled

Jul 29th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.17 KB | None | 0 0
  1. # Import the GUI widgets that you'll be using, and create the 'app' for your program.
  2. from guizero import App, TextBox, PushButton, Text, info
  3. from time import time, sleep
  4. app = App()
  5.  
  6. # Function definitions for your events go here.
  7. def btn_go_clicked():
  8.     info("Greetings","Hello, " + txt_name.value + " - I hope you're having a nice day")
  9.  
  10. def btn_go_clicked2():
  11.     info("Say hello","Your name is " + txt_name.value+"and you like "+ txt_name2.value)
  12.  
  13. def btn_go_clicked3():
  14.     if txt_name3.value==txt_name4.value:
  15.         info("Checking","Your password is correct")
  16.     else:
  17.         info("Checking","Your password does not match. Try again.")
  18.        
  19.  
  20.  
  21. # Your GUI widgets go here
  22. lbl_name = Text(app, text="Hello. What's your name?")
  23. txt_name = TextBox(app)
  24.  
  25. lbl_name2 = Text(app, text="What's your favorite pet")
  26. txt_name2= TextBox(app)
  27.  
  28. btn_go = PushButton(app, command=btn_go_clicked, text="Done")
  29. btn_go2=PushButton(app, command=btn_go_clicked2, text="Say")
  30.  
  31. lbl_name3= Text(app, text="Write your passwrod in the boxes below")
  32. txt_name3=TextBox(app)
  33. txt_name4=TextBox(app)
  34.  
  35. btn_go3=PushButton(app, command=btn_go_clicked3, text="Check")
  36. # Show the GUI on the screen
  37. app.display()
Advertisement
Add Comment
Please, Sign In to add comment