import tkinter as tk
import tkinter.messagebox
qq = tk.Tk()
qq.geometry('800x600')
qq.title('一只企鹅')
user1 = tk.StringVar()
user2 = tk.StringVar()
def click(win):
mimaku = {'1462638662': '000000', '123': '123'} # ,123:123}
if entry1.get() in mimaku and entry2.get() == mimaku[entry1.get()]:
tk.messagebox.showinfo('666', "密码正确") # 标题名,内容
new_window(win)
else:
tk.messagebox.showinfo('000', "密码错误") # 标题名,内容
def new_window(win):
win2 = tk.Toplevel(win)
win2.geometry('400x400')
win2.title('两只企鹅')
user1 = tk.StringVar()
user2 = tk.StringVar()
entry1 = tk.Entry(
qq,
show='',
font=(None, 20),
textvariable=user1
)
entry1.place(x=150, y=150, width=500, height=50)
entry2 = tk.Entry(
qq,
show="*",
font=(None, 30),
textvariable=user2
)
entry2.place(x=150, y=230, width=500, height=50)
btn = tk.Button(
qq,
text="登陆",
bg="black",
fg='white',
font=(None, 20),
width=5,
height=2,
command=lambda: click(qq),
)
btn.place(x=360, y=430, width=80, height=50)
btn = tk.Button(
qq,
text="找回密码",
fg="black",
bg='white',
font=(None, 10),
width=5,
height=2,
command=lambda: click(qq),
)
btn.place(x=700, y=500, width=80, height=50)
lab1 = tk.Label(
qq,
text='账号:',
font=(None, 20),
)
lab1.place(x=80, y=150, width=50, height=50)
lab2 = tk.Label(
qq,
text='密码:',
font=(None, 20),
)
lab2.place(x=80, y=230, width=50, height=50)
# 检查按钮
ck1 = tk.Checkbutton(
qq,
text = "自动登录",
font=(None, 20),
state = "disabled"
)
ck1.place(x=450, y=330)
# 选择
ck1.select()
ck2 = tk.Checkbutton(
qq,
text = "记住密码",
font=(None, 20),
state="disabled"
)
ck2.place(x=200, y=330)
ck2.select()
qq.mainloop()
runze - 完整版qq登陆界面
最新推荐文章于 2021-07-10 14:12:57 发布