from tkinter import ttk
import tkinter
import tkinter.messagebox
from xitong import gongneng
from xitong import data
class logo(object):
def uu2(self):
id = self.id.get()
password = self.password.get()
item=data.data().find_one(id,password)
if item:
# tkinter.messagebox.showinfo('提示', '登录成功请稍后....')
self.rooy.destroy()
gongneng.gny().register2()
else:
tkinter.messagebox.showwarning('警告','您输入的密码或账户有误!')
def uu1(self):
self.rooy = tkinter.Tk()
self.rooy.geometry('300x200')
#
id = tkinter.Label(self.rooy, text='账户:')
password = tkinter.Label(self.rooy, text='密码:')
id.place(x=60,y=80)
password.place(x=60,y=120)
str1 = tkinter.StringVar()
str2 = tkinter.StringVar()
self.id = tkinter.Entry(self.rooy, text='请输入ID', textvariable=str1)
self.password= tkinter.Entry(self.rooy, text='请输入password', textvariable=str2)
self.id.place(x=110,y=80)
self.password.place(x=110,y=120)
self.bt1=ttk.Button(self.rooy,text='登录',command = self.uu2)
self.bt1.place(x=50,y=160)
self.bt1=ttk.Button(self.rooy,text='取消',command=self.rooy.quit)
self.bt1.place(x=180,y=160)
self.rooy.mainloop()
if __name__ == '__main__':
spider = logo()
spider.uu1()
|