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()
- # Function definitions for access granted and denied.
- def btn_go_clicked():
- if txt1_name.value == txt2_name.value:
- info("Password","Access Granted")
- else:
- info("Password","Access Denied")
- # GUI widgets 2 labels and 2 text boxes
- lbl1_name = Text(app, text="Please enter the password")
- txt1_name = TextBox(app)
- lbl2_name = Text(app, text="Please re-enter the password")
- txt2_name = TextBox(app)
- btn_go = PushButton(app, command=btn_go_clicked, text="Enter")
- # Show the GUI on the screen
- app.display()
Add Comment
Please, Sign In to add comment