Мне нужно, чтобы функция проверяла один и тот же пароль, введенный в обоих полях, и возвращала графический интерфейс пользователя с правильным или неправильным паролем.
from tkinter import *
from tkinter.messagebox import *
def change_password(password):
""" The Function confirms the change of password """
password = entered_password.get()
if entered_password == password:
box.showinfo("info","The password has been changed")
else:
box.showinfo("info","Password mismatch. The password has not been
changed")
root_window = Tk()
root_window.title("t")
root_window.geometry("175 x 90")
menu bar = Menu(root_window)
password_label = Label(root_window, text = "Please enter your password.")
password_label.pack()
entered_data = String Var()
text_area = Entry(root_window, show = "*", text variable = entered_data,
width=20)
text_area.pack()
entered_data = String Var()
text_area = Entry(root_window, show = "*", text variable = entered_data,
width=20)
text_area.pack()
password_button = Button(None, text = "Change password", command =
change_password)
password_button.pack()
root_window.config(menu = menubar)
root_window.mainloop()