|
发表于 2020-5-9 10:01:58
|
显示全部楼层
- import ctypes
- whnd = ctypes.windll.kernel32.GetConsoleWindow()
- if whnd != 0:
- ctypes.windll.user32.ShowWindow(whnd, 0)
- ctypes.windll.kernel32.CloseHandle(whnd)
- from tkinter import *
- from tkinter import messagebox as g
- a = 3
- def yan_zheng():
- global a
- if (user.get() == 'ilove') and (pwd.get() == 'fishc.com'):
- g.showinfo('', '欢迎登陆我们的网站')
- g.showinfo('', '读取信息中……')
- g.showinfo('', '空!')
- g.showinfo('', '正在退出中')
- root.quit()
- elif a == 0:
- g.showinfo('', '你已经没有机会了!')
- root.quit()
- else:
- g.showinfo('', '您的账后密码错误,您还有%d次机会' % a)
- g.showinfo('', '请从新输入')
- a -= 1
-
- root = Tk()
- root.title("登录界面")
- root.geometry("500x600")
- ti_jiao = Button(root, text='提交', font=('楷体', 18), command=yan_zheng).place(x=170, y=100)
- Label(root, font=('楷体', 18), text='请输入用户名:').place(x=10, y=10)
- user = Entry(root, font=('楷体', 18))
- user.place(x=170, y=10)
- Label(root, font=('楷体', 18), text=' 请输入密码:').place(x=10, y=50)
- pwd = Entry(root, font=('楷体', 18))
- pwd.place(x=170, y=50)
- root.mainloop()
复制代码
这个行不行
能不能成为最佳答案??  |
评分
-
查看全部评分
|