Commit e334be70 by BellCodeEditor

save project

parent 877c0d6f
Showing with 9 additions and 3 deletions
import tkinter as tk
var = tk.StringVar()
def btn():
global var
global en_user
......@@ -8,18 +7,24 @@ def btn():
password = en_pass.get()
if usersname == "ak47" and password == 'dnfh':
var.set("登录成功!")
elif usersname != 'ak47':
var.set("用户名错误")
elif password != 'dnfh':
var.set("密码错误!")
else:
var.set("dnfh傻逼滚!")
var.set("用户名和密码错误!")
root = tk.Tk()
root.geometry("200x150")
root.title("登录")
var = tk.StringVar()
en_user = tk.Entry(root)
en_pass = tk.Entry(root)
la = tk.Label(root,width = 200, height = 30 ,bgcolor = 'blue',textvariable = var)
la = tk.Label(root,width = 200,textvariable = var)
# usersname = input("请输入用户名:")
# password = input("请输入密码:")
bt = tk.Button(root, width = 10,height = 2,text = '确认',command = btn)
la.pack()
en_user.pack()
en_pass.pack()
bt.pack()
root.mainloop()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment