from tkinter import *
import tkinter as tk
L=[['123','123'],['456','456']]
root=win=tk.Tk()
root.title("用户登录")
root.geometry('240x150')
Label(root,text='用户名',width='6').place(x=3,y=2)
Label(root,text='密码',width='6').place(x=3,y=20)
entryCd4=tk.Entry(root)
entryCd4.pack()
entryCd5=tk.Entry(root)
entryCd5.pack()
def denglu():
user=str(entryCd4.get())
mima=str(entryCd5.get())
U=[user,mima]
i=0
for l in L:
if U==l:
root=win=tk.Tk()
root.title('登录成功')
root.geometry('600x800')
root.mainloop()
else :
i+=1
if i>=10:
root=win=tk.Tk()
root.title('登录失败')
root.geometry('200x150')
root.mainloop()
bunt=tk.Button(root,text='登录',command=denglu)
bunt.pack()
root.mainloop()
09-21
2754
04-18
4555