maroph icon

check_password.py

maroph | PRO | 12/06/19 03:55:12 PM UTC | 0 ⭐ | 382 👁️ | Never ⏰ | []
Python |

510 B

|

None

|

0 👍

/

0 👎

from guizero import App, TextBox, PushButton, Text, info
app = App()
 
def btn_go_clicked():
    if txt_password.value == txt_password2.value:
        info("OK", "passwords are the same")
    else:
        info("ERROR", "passwords differ")
 
 
lbl_password = Text(app, text="Enter password")
txt_password = TextBox(app, hide_text=True)
 
lbl_password2 = Text(app, text="Repeat password")
txt_password2 = TextBox(app, hide_text=True)
 
btn_go = PushButton(app, command=btn_go_clicked, text="Done")
 
app.display()

Comments