欢迎光临散文网 会员登陆 & 注册

库存管理界面(tk多界面,一个程序)

2020-04-04 19:43 作者:一心想当网红的李老师  | 我要投稿

from tkinter import *


####实验总清单

lab=[]

lab=["503废水处理","503微波合成","505","507","509","511","513"]

####管理者界面

def admincontrol():

    admin=Tk()

    admin.title("管理员界面")

    admin.geometry("320x150")

    lb1=Label(admin,text="账号",width=15)

    lb1.place(x=10,y=10)

    IDEntry=Entry(admin)

    IDEntry.place(x=100,y=10)

    lb2=Label(admin,text="密码",width=15)

    lb2.place(x=10,y=40)

    PWEntry=Entry(admin)

    PWEntry.place(x=100,y=40)

    SuperBtn=Button(admin,text="超级管理员",width=15,command=supercon)

    NormalBtn=Button(admin,text="管理员",width=15,command=normalcon)

    SuperBtn.place(x=100,y=80)

    NormalBtn.place(x=100,y=120)

    admin.mainloop()


###超级管理员权限    

def supercon():

    print("super")





###一般管理员权限    

def normalcon():

    print("normal")




def teacher():

    teacher=Tk()

    teacher.title("教师管理界面")

    teacher.geometry("320x160")

    lb1=Label(teacher,text="账号",width=15)

    lb1.place(x=10,y=10)

    IDEntry=Entry(teacher)

    IDEntry.place(x=100,y=10)

    lb2=Label(teacher,text="密码",width=15)

    lb2.place(x=10,y=40)

    PWEntry=Entry(teacher)

    PWEntry.place(x=100,y=40)

    Btnyes=Button(teacher,text="登录",width=15,command=login)

    Btnyes.place(x=10,y=80)

    Btnno=Button(teacher,text="取消",width=15,command=giveup)

    Btnno.place(x=200,y=80)

    teacher.mainloop()


def login():

    print("hh")


def giveup():

    print("nn")

    

def stu():

    stu=Tk()

    stu.title("学生使用界面")

    stu.geometry("320x480")

    lb1=Label(stu,text="账号",width=15)

    lb1.place(x=10,y=10)

    IDEntry=Entry(stu)

    IDEntry.place(x=100,y=10)

    lb2=Label(stu,text="密码",width=15)

    lb2.place(x=10,y=40)

    PWEntry=Entry(stu)

    PWEntry.place(x=100,y=40)

    lb3=Label(stu,text="实验名称",width=15)

    lb3.place(x=10,y=70)

    lb=Listbox(stu)    

    for each_item in lab:

        lb.insert(END,each_item)

        lb.bind("<<ListboxSelect>>",itemselect)

    lb.place(x=100,y=70)

    Btnyes=Button(stu,text="登录",width=15,command=stulogin)

    Btnyes.place(x=10,y=410)

    Btnno=Button(stu,text="取消",width=15,command=stugiveup)

    Btnno.place(x=200,y=410)

    stu.mainloop()


def itemselect(event):

    obj=event.widget

    indexs=obj.curselection()

    for index in indexs:

        print(obj.get(index))

    print("-----")

    

def stulogin():

    print("fff")



def stugiveup():

    print("ddd")


#####主界面窗口

main=Tk()

main.title("安全管理主页")

main.geometry("320x400")

adminBtn=Button(main,text="管理员",width=15,command=admincontrol)

teachBtn=Button(main,text="教师",width=15,command=teacher)

stuBtn=Button(main,text="学生",width=15,command=stu)

adminBtn.place(x=100,y=50)

teachBtn.place(x=100,y=150)

stuBtn.place(x=100,y=250)

main.mainloop()


库存管理界面(tk多界面,一个程序)的评论 (共 条)

分享到微博请遵守国家法律