Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import the GUI widgets that you'll be using, and create the 'app' for your program.
- from guizero import App, TextBox, PushButton, Text, info
- app = App(layout="grid")
- # Function definitions for your events go here.
- def btn_checkPassword_clicked():
- if txt_user == "" :
- if txt_password1 == txt_password2 :
- info("Password Check", "Your passwords match!")
- else :
- info("Password Check", "Your passwords unmatch!")
- else :
- info("Password Check", "Pls fill username!")
- # Your GUI widgets go here
- lbl_user = Text(app, text="username:", grid=[0,0], align="left")
- txt_user = TextBox(app, width=20, grid=[1,0])
- lbl_password = Text(app, text="password:", grid=[0,1], align="left")
- txt_password1 = TextBox(app, text="enter password", width=20, grid=[1,1])
- txt_password2 = TextBox(app, text="re-enter password", width=20, grid=[1,2])
- btn_checkPassword = PushButton(app, command=btn_checkPassword_clicked, text="Done", grid=[1,3], align="left")
- # Show the GUI on the screen
- app.display() # Write your code here :-)
Advertisement
Add Comment
Please, Sign In to add comment