python3 GUI- 登陆界面
from tkinter import *
root = Tk()
def Show():
root1 = Tk()
if En.get() == 'user' and En1.get() == '123':
Label(root1, text='登陆成功!', bg='Gold', fg='blue', width=30, height=8, anchor='c').pack()
else:
Label(root1, text='用户名或密码错误!', bg='red', fg='blue', width=30, height=8, anchor='c').pack()
label = Label(root, text='用户名:', anchor='c').grid(row=0)
En = Entry(root)
En.grid(row=0, column=1)
label1 = Label(root, text='密码 :', anchor='c').grid(row=1)
En1 = Entry(root, show='*')
En1.grid(row=1, column=1)
Button(root, text='退出', anchor='c', width=6, height=1, command=root.quit).grid(row=2, column=0)
Button(root, text='确定', anchor='c', width=6, height=1, command=Show).grid(row=2, column=1)
root.mainloop()
执行结果: