Advertisement
zhongnaomi

enter a password twice gui 1

Sep 10th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 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,error
  3. app = App()
  4.  
  5. # Function definitions for your events go here.
  6. def btn_go_clicked():
  7.     if first_password.value == second_password.value:
  8.         info("Greetings","your password is  " + first_password.value  )
  9.     else:
  10.         error("Greetings","Please; enter the same password. Please,try again")
  11.        
  12.        
  13.    
  14.  
  15. # Your GUI widgets go here
  16. q1_password = Text(app, text="Please; enter your password")
  17. first_password = TextBox(app)
  18. q2_password= Text(app, text="Enter once again your password")
  19. second_password = TextBox(app)
  20. btn_go = PushButton(app, command=btn_go_clicked, text="Done")
  21.  
  22. # Show the GUI on the screen
  23. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement