我做了一个小程序,它会询问你的密码和用户名。输入详细信息后,它应该检查密码和用户名是否正确。我该如何接近并做到这一点?
from tkinter import *
from getpass import getpass
def callback():
print(E1)()
top = Tk()
L1 = Label(top, text="User Name")
L1.grid(row=0, column=0)
E1 = Entry(top, bd = 5)
E1.grid(row=0, column=1)
L1 = Label(top, text="Password")
L1.grid(row=1, column=0)
E1 = Entry(top, bd = 5,show="•")
E1.grid(row=1, column=1)
MyButton1 = Button(top, text="Submit", width=10, command=callback)
MyButton1.grid(row=3, column=1)
top.mainloop()