python tk窗口学生宿舍管理系统

阅读: 评论:0

python tk窗口学生宿舍管理系统

python tk窗口学生宿舍管理系统

Python 图形化编辑常用的工具有很多,例如:
Tkinter:Tkinter 是 Python 的标准 GUI(图形用户界面)库,它提供了一个快速简便的方法来创建 GUI 应用程序。Tkinter 是面向对象的,封装了Tk GUI工具包的Python接口。使用 Tkinter,可以创建简单的图形化界面,例如窗口、按钮、标签等。它非常适合初学者和中小学生的信息技术教育。
PyQt:PyQt 是一个功能强大的图形用户界面库,基于 Qt 库,为 Python 提供了丰富的 GUI 组件和功能。PyQt 适合开发复杂的应用程序,支持跨平台操作,可以在 Windows、MacOS 和 Linux 上运行。
wxPython:wxPython 是一个开源的 Python GUI 工具包,用于创建跨平台的图形用户界面。wxPython 支持多种操作系统,如 Windows、MacOS 和 Linux。它提供了丰富的控件,可以创建复杂的 GUI 应用程序。
Kivy:Kivy 是一个开源的 Python GUI 工具包,用于开发多点触摸应用程序。它可以运行在 Windows、Linux、OS X、Android 和 iOS 等平台上。Kivy 提供了丰富的控件,使得开发人员可以轻松地创建出美观且功能强大的应用程序。等等

虽然Tkinter窗口已经存在很长时间,界面设计也没有其他工具精细,但仍然是各大学校教学常用工具,对于初学者也非常友好,本文将通过Tkinter设计一个学生住宿系统。

主要实现如下功能:

1.管理系统要实现学生信息的录入,删除,检索。
2.使用一个二阶列表来模拟数据库储存学生信息(感兴趣的朋友可以试着外链数据库实现,这里不再做赘述。)
3.宿舍管理系统录入信息时,需要避免错误信息和重复信息并给予提示。
4.在检索宿舍信息的时候,使用学生的姓名,班级和住址作为主码。
5.学生的录入和检索应该区分男女生宿舍其信息分别储存,以便于检索方便。
6.点击相应功能按钮时打开新的窗口并关闭原来窗口。
7.灵活操作,每集页面需添加返回上级菜单功能和返回主菜单功能。

废话少说,上代码:

import tkinter as Tk
def f1():app.destroy()global app1app1 = Tk.Tk()app1.update()ry('800x600')app1.title("学生查询系统")fig(bg="gray")m = Tk.Message(app1, text="学生查询系统", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)t1 = " 寝室公约1n  1、早晨起床轻手轻脚,不要制造声响。n  2、每天的值日生必须按时将宿舍打扫干净,及时处理垃圾。n3、电脑音响开到自己能听见即可,戴上耳机更好。n  4、个人物品放在各自的橱柜里,不得乱扔,更不要随便占领别人的地盘。n5、卧谈会时间不宜过长,适可而止,最晚12点睡觉。n  6、进出请随手关门。n  7、未经允许,不要乱拿他人的东西。n8、搞好个人卫生,勤洗衣服勤洗澡。n  9、在宿舍有大声唱歌、抽烟、打呼噜等特殊嗜好者,除非其他人都欣赏,否则请慢慢改掉。n10、最后一个离开宿舍者,关好窗子锁好门。n"m2 = Tk.Message(app1, text=t1, font=("SimKai", 15, "bold"))m2.config(bg="gray", width=400)m2.place(x=380, y=70, width=400, height=520)b1 = Tk.Button(app1, text="男生宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=40, y=150, width=200, height=90)b2 = Tk.Button(app1, text="女生宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=40, y=260, width=200, height=90)b3 = Tk.Button(app1, text="请假学生", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=40, y=370, width=200, height=90)b4 = Tk.Button(app1, text="主菜单", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=40, y=480, width=200, height=90)def f1_1():app1.destroy()global app1_1app1_1 = Tk.Tk()app1_1.update()ry('800x600')app1_1.title("男生宿舍")fig(bg="gray")m = Tk.Message(app1_1, text="男生宿舍", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)b1 = Tk.Button(app1_1, text="一号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=50, y=150, width=200, height=90)b2 = Tk.Button(app1_1, text="二号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=300, y=150, width=200, height=90)b3 = Tk.Button(app1_1, text="三号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=550, y=150, width=200, height=90)b4 = Tk.Button(app1_1, text="四号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=50, y=260, width=200, height=90)b5 = Tk.Button(app1_1, text="五号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b5.place(x=300, y=260, width=200, height=90)b6 = Tk.Button(app1_1, text="六号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b6.place(x=550, y=260, width=200, height=90)b7 = Tk.Button(app1_1, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b7.place(x=560, y=560, width=200, height=35)b8 = Tk.Button(app1_1, text="主菜单", font=("SimKai", 15, "bold"), command=f1_32_fig(bg="gray", width=200)b8.place(x=40, y=560, width=200, height=35)b9 = Tk.Button(app1_1, text="学生搜索", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b9.place(x=50, y=400, width=700, height=90)
def f1_2():app1.destroy()global app1_2app1_2 = Tk.Tk()app1_2.update()ry('800x600')app1_2.title("女生宿舍")fig(bg="gray")m = Tk.Message(app1_2, text="女生宿舍", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)b1 = Tk.Button(app1_2, text="一号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=50, y=150, width=200, height=90)b2 = Tk.Button(app1_2, text="二号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=300, y=150, width=200, height=90)b3 = Tk.Button(app1_2, text="三号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=550, y=150, width=200, height=90)b4 = Tk.Button(app1_2, text="四号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=50, y=260, width=200, height=90)b5 = Tk.Button(app1_2, text="五号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b5.place(x=300, y=260, width=200, height=90)b6 = Tk.Button(app1_2, text="六号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b6.place(x=550, y=260, width=200, height=90)b7 = Tk.Button(app1_2, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b7.place(x=560, y=560, width=200, height=35)b8 = Tk.Button(app1_2, text="主菜单", font=("SimKai", 15, "bold"), command=f1_32_fig(bg="gray", width=200)b8.place(x=40, y=560, width=200, height=35)b9 = Tk.Button(app1_2, text="学生搜索", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b9.place(x=50, y=400, width=700, height=90)
def f1_3(t):t.destroy()global app;app = Tk.Tk()ry('800x600')app.title("宿舍管理系统")fig(bg="gray")m = Tk.Message(app, text="学生公寓", font=("SimKai", 30, "bold"))m.config(bg="gray", width=200)m.place(x=0, y=20, width=800, height=60)t1 = " 寝室公约1n  1、早晨起床轻手轻脚,不要制造声响。n  2、每天的值日生必须按时将宿舍打扫干净,及时处理垃圾。n3、电脑音响开到自己能听见即可,戴上耳机更好。n  4、个人物品放在各自的橱柜里,不得乱扔,更不要随便占领别人的地盘。n5、卧谈会时间不宜过长,适可而止,最晚12点睡觉。n  6、进出请随手关门。n  7、未经允许,不要乱拿他人的东西。n8、搞好个人卫生,勤洗衣服勤洗澡。n  9、在宿舍有大声唱歌、抽烟、打呼噜等特殊嗜好者,除非其他人都欣赏,否则请慢慢改掉。n10、最后一个离开宿舍者,关好窗子锁好门。n"m2 = Tk.Message(app, text=t1, font=("SimKai", 15, "bold"))m2.config(bg="gray", width=400)m2.place(x=380, y=70, width=400, height=520)b1 = Tk.Button(app, text="学生查询", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b1.place(x=40, y=150, width=200, height=90)b2 = Tk.Button(app, text="学生入住", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b2.place(x=40, y=260, width=200, height=90)b3 = Tk.Button(app, text="学生退宿", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b3.place(x=40, y=370, width=200, height=90)b4 = Tk.Button(app, text="退出系统", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b4.place(x=40, y=480, width=200, height=90)
def f1_4():app1.destroy()global app1_3,l1,s1app1_3 = Tk.Tk()app1_3.update()ry('800x600')app1_3.title("请假学生")fig(bg="gray")m = Tk.Message(app1_3, text="请假学生", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)b1 = Tk.Button(app1_3, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=560, y=530, width=200, height=35)b2 = Tk.Button(app1_3, text="主菜单", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=40, y=530, width=200, height=35)b3 = Tk.Button(app1_3, text="开始检索", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=300, y=530, width=200, height=35)s1 = Tk.Scrollbar(app1_3)l1 = Tk.Listbox(app1_3, yscrollcommand=s1.fig(bg="gray", font=("SimKai", 20, "bold"), width=fig(command=l1.yview)l1.place(x=50, y=120, width=700, height=360)s1.place(x=50, y=120, width=700, height=360)def f1_41():app1_3.destroy()global app1app1 = Tk.Tk()app1.update()ry('800x600')app1.title("学生查询系统")fig(bg="gray")m = Tk.Message(app1, text="学生查询系统", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)t1 = " 寝室公约1n  1、早晨起床轻手轻脚,不要制造声响。n  2、每天的值日生必须按时将宿舍打扫干净,及时处理垃圾。n3、电脑音响开到自己能听见即可,戴上耳机更好。n  4、个人物品放在各自的橱柜里,不得乱扔,更不要随便占领别人的地盘。n5、卧谈会时间不宜过长,适可而止,最晚12点睡觉。n  6、进出请随手关门。n  7、未经允许,不要乱拿他人的东西。n8、搞好个人卫生,勤洗衣服勤洗澡。n  9、在宿舍有大声唱歌、抽烟、打呼噜等特殊嗜好者,除非其他人都欣赏,否则请慢慢改掉。n10、最后一个离开宿舍者,关好窗子锁好门。n"m2 = Tk.Message(app1, text=t1, font=("SimKai", 15, "bold"))m2.config(bg="gray", width=400)m2.place(x=380, y=70, width=400, height=520)b1 = Tk.Button(app1, text="男生宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=40, y=150, width=200, height=90)b2 = Tk.Button(app1, text="女生宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=40, y=260, width=200, height=90)b3 = Tk.Button(app1, text="请假学生", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=40, y=370, width=200, height=90)b4 = Tk.Button(app1, text="主菜单", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=40, y=480, width=200, height=90)
def f1_42():f1_3(app1_3)
def f1_43():text = ["姓名  性别 住址 班级 入住情况n"]text1 = ""h = 1for i in Boydormitory:for j in i:if "请假" in j:text.append(j)h = 0for i2 in Femaledormitory:for j2 in i2:if "请假" in j2:text.append(j2)h = 0if h == 1:l1.delete(0, Tk.END)text1 = "该公寓查无人请假!!!!!!!!"l1.insert(Tk.END, text1)l1.place(x=50, y=120, width=700, height=360)s1.place(x=50, y=120, width=700, height=360)else:l1.delete(0, Tk.END)for g in text:l1.insert(Tk.END, g)l1.place(x=50, y=120, width=700, height=360)s1.place(x=50, y=120, width=700, height=360)
#***********************************************************************************************************************
def f1_31():f1_3(app1)
def f1_32_1():f1_3(app1_1)
def f1_32_2():f1_3(app1_2)
def f1_33():f1_3(app1_11)
def f1_12_1():f1_12_(app1_1)
def f1_12_2():f1_12_(app1_2)
def f1_32_21():f1_3(app1_11)
def f1_12_21():app1_11.destroy()global app1_1app1_1 = Tk.Tk()app1_1.update()ry('800x600')app1_1.title("男生宿舍")fig(bg="gray")m = Tk.Message(app1_1, text="男生宿舍", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)b1 = Tk.Button(app1_1, text="一号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=50, y=150, width=200, height=90)b2 = Tk.Button(app1_1, text="二号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=300, y=150, width=200, height=90)b3 = Tk.Button(app1_1, text="三号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=550, y=150, width=200, height=90)b4 = Tk.Button(app1_1, text="四号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=50, y=260, width=200, height=90)b5 = Tk.Button(app1_1, text="五号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b5.place(x=300, y=260, width=200, height=90)b6 = Tk.Button(app1_1, text="六号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b6.place(x=550, y=260, width=200, height=90)b7 = Tk.Button(app1_1, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b7.place(x=560, y=560, width=200, height=35)b8 = Tk.Button(app1_1, text="主菜单", font=("SimKai", 15, "bold"), command=f1_32_fig(bg="gray", width=200)b8.place(x=40, y=560, width=200, height=35)b9 = Tk.Button(app1_1, text="学生搜索", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b9.place(x=50, y=400, width=700, height=90)
def f1_12_22():app1_11.destroy()global app1_2app1_2 = Tk.Tk()app1_2.update()ry('800x600')app1_2.title("女生宿舍")fig(bg="gray")m = Tk.Message(app1_2, text="女生宿舍", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)b1 = Tk.Button(app1_2, text="一号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=50, y=150, width=200, height=90)b2 = Tk.Button(app1_2, text="二号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=300, y=150, width=200, height=90)b3 = Tk.Button(app1_2, text="三号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=550, y=150, width=200, height=90)b4 = Tk.Button(app1_2, text="四号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=50, y=260, width=200, height=90)b5 = Tk.Button(app1_2, text="五号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b5.place(x=300, y=260, width=200, height=90)b6 = Tk.Button(app1_2, text="六号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b6.place(x=550, y=260, width=200, height=90)b7 = Tk.Button(app1_2, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b7.place(x=560, y=560, width=200, height=35)b8 = Tk.Button(app1_2, text="主菜单", font=("SimKai", 15, "bold"), command=f1_32_fig(bg="gray", width=200)b8.place(x=40, y=560, width=200, height=35)b9 = Tk.Button(app1_2, text="学生搜索", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b9.place(x=50, y=400, width=700, height=90)
#***********************************************************************************************************************
def f1_111():f1_11(1,1)
def f1_112():f1_11(2,1)
def f1_113():f1_11(3,1)
def f1_114():f1_11(4,1)
def f1_115():f1_11(5,1)
def f1_116():f1_11(6,1)
def f1_121():f1_11(1,2)
def f1_122():f1_11(2,2)
def f1_123():f1_11(3,2)
def f1_124():f1_11(4,2)
def f1_125():f1_11(5,2)
def f1_126():f1_11(6,2)
#***********************************************************************************************************************
def f41():f4(1)
def f42():f4(2)
#***********************************************************************************************************************
def f4(t):if t==1:app1_1.destroy()text1="男生宿舍检索"else:app1_2.destroy()text1 = "女生宿舍检索"global  app1_11,m3,l1,s1,e1app1_11 = Tk.Tk()app1_11.update()ry('800x600')app1_11.title(text1)fig(bg="gray")m = Tk.Message(app1_11, text=text1, font=("SimKai", 30, "bold"))m.config(bg="gray", width=600)m.place(x=0, y=20, width=800, height=60)m1 = Tk.Message(app1_11, text="输入姓名或信息", font=("SimKai", 15, "bold"))m1.config(bg="gray", width=200)m1.place(x=50, y=150, width=200, height=90)m2 = Tk.Message(app1_11, text="检索结果", font=("SimKai",15,"bold"))m2.config(bg="gray", width=400)m2.place(x=380, y=150, width=400, height=90)e1=Tk.Entry(app1_11, font=("SimKai", 11))e1.config(bg="gray",width=200)e1.place(x=50,y=280,width=200,height=100)s1=Tk.Scrollbar(app1_11)l1=Tk.Listbox(app1_11,yscrollcommand=s1.fig(bg="gray", font=("SimKai",15,"bold"),width=fig(command=l1.yview)l1.place(x=380, y=260, width=400, height=260)s1.place(x=380, y=260, width=400, height=260)if t == 1:b1 = Tk.Button(app1_11, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b1.place(x=560, y=560, width=200, height=35)b3 = Tk.Button(app1_11, text="OK", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b3.place(x=50, y=440, width=200, height=35)else:b1 = Tk.Button(app1_11, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b1.place(x=560, y=560, width=200, height=35)b3 = Tk.Button(app1_11, text="OK", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b3.place(x=50, y=440, width=200, height=35)b2 = Tk.Button(app1_11, text="主菜单", font=("SimKai", 15, "bold"), command=f1_32_fig(bg="gray", width=200)b2.place(x=40, y=560, width=200, height=35)
#***********************************************************************************************************************
def f1_11(t,n):if n==1:app1_1.destroy()else:app1_2.destroy()global app1_11if n==1:if t == 1:text1 = "男生一号宿舍"elif t == 2:text1 = "男生二号宿舍"elif t == 3:text1 = "男生三号宿舍"elif t == 4:text1 = "男生四号宿舍"elif t == 5:text1 = "男生五号宿舍"else:text1 = "男生六号宿舍"else:if t == 1:text1 = "女生一号宿舍"elif t == 2:text1 = "女生二号宿舍"elif t == 3:text1 = "女生三号宿舍"elif t == 4:text1 = "女生四号宿舍"elif t == 5:text1 = "女生五号宿舍"else:text1 = "女生六号宿舍"app1_11 = Tk.Tk()app1_11.update()ry('800x600')app1_11.title(text1)fig(bg="gray")m = Tk.Message(app1_11, text=text1, font=("SimKai", 30, "bold"))m.config(bg="gray", width=600)m.place(x=0, y=20, width=800, height=60)text2=""if n==1:for i in Boydormitory[t - 1]:text2 = text2 + ielse:for i in Femaledormitory[t - 1]:text2 = text2 + im2 = Tk.Message(app1_11, text=text2, font=("SimKai", 15, "bold"))m2.config(bg="gray", width=800)m2.place(x=0, y=80, width=800, height=250)if n==1:b1 = Tk.Button(app1_11, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_11_1)else:b1 = Tk.Button(app1_11, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_11_fig(bg="gray", width=200)b1.place(x=560, y=560, width=200, height=35)b2 = Tk.Button(app1_11, text="主菜单", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=40, y=560, width=200, height=35)#**********************************************************************************************************************def f1_11_1():app1_11.destroy()global app1_1app1_1 = Tk.Tk()app1_1.update()ry('800x600')app1_1.title("男生宿舍")fig(bg="gray")m = Tk.Message(app1_1, text="男生宿舍", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)b1 = Tk.Button(app1_1, text="一号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=50, y=150, width=200, height=90)b2 = Tk.Button(app1_1, text="二号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=300, y=150, width=200, height=90)b3 = Tk.Button(app1_1, text="三号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=550, y=150, width=200, height=90)b4 = Tk.Button(app1_1, text="四号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=50, y=260, width=200, height=90)b5 = Tk.Button(app1_1, text="五号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b5.place(x=300, y=260, width=200, height=90)b6 = Tk.Button(app1_1, text="六号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b6.place(x=550, y=260, width=200, height=90)b6.place(x=550, y=260, width=200, height=90)b7 = Tk.Button(app1_1, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b7.place(x=560, y=560, width=200, height=35)b8 = Tk.Button(app1_1, text="主菜单", font=("SimKai", 15, "bold"), command=f1_32_fig(bg="gray", width=200)b8.place(x=40, y=560, width=200, height=35)b9 = Tk.Button(app1_1, text="姓名搜索", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b9.place(x=50, y=400, width=700, height=90)
def f1_11_2():app1_11.destroy()global app1_2app1_2 = Tk.Tk()app1_2.update()ry('800x600')app1_2.title("女生宿舍")fig(bg="gray")m = Tk.Message(app1_2, text="女生宿舍", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)b1 = Tk.Button(app1_2, text="一号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=50, y=150, width=200, height=90)b2 = Tk.Button(app1_2, text="二号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=300, y=150, width=200, height=90)b3 = Tk.Button(app1_2, text="三号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=550, y=150, width=200, height=90)b4 = Tk.Button(app1_2, text="四号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=50, y=260, width=200, height=90)b5 = Tk.Button(app1_2, text="五号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b5.place(x=300, y=260, width=200, height=90)b6 = Tk.Button(app1_2, text="六号宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b6.place(x=550, y=260, width=200, height=90)b7 = Tk.Button(app1_2, text="上级菜单", font=("SimKai", 15, "bold"), command=f1_12_fig(bg="gray", width=200)b7.place(x=560, y=560, width=200, height=35)b8 = Tk.Button(app1_2, text="主菜单", font=("SimKai", 15, "bold"), command=f1_32_fig(bg="gray", width=200)b8.place(x=40, y=560, width=200, height=35)b9 = Tk.Button(app1_2, text="姓名搜索", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=200)b9.place(x=50, y=400, width=700, height=90)
def f1_12_(t):t.destroy()global app1app1 = Tk.Tk()app1.update()ry('800x600')app1.title("学生查询系统")fig(bg="gray")m = Tk.Message(app1, text="学生查询系统", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)t1 = " 寝室公约1n  1、早晨起床轻手轻脚,不要制造声响。n  2、每天的值日生必须按时将宿舍打扫干净,及时处理垃圾。n3、电脑音响开到自己能听见即可,戴上耳机更好。n  4、个人物品放在各自的橱柜里,不得乱扔,更不要随便占领别人的地盘。n5、卧谈会时间不宜过长,适可而止,最晚12点睡觉。n  6、进出请随手关门。n  7、未经允许,不要乱拿他人的东西。n8、搞好个人卫生,勤洗衣服勤洗澡。n  9、在宿舍有大声唱歌、抽烟、打呼噜等特殊嗜好者,除非其他人都欣赏,否则请慢慢改掉。n10、最后一个离开宿舍者,关好窗子锁好门。n"m2 = Tk.Message(app1, text=t1, font=("SimKai", 15, "bold"))m2.config(bg="gray", width=400)m2.place(x=380, y=70, width=400, height=520)b1 = Tk.Button(app1, text="男生宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b1.place(x=40, y=150, width=200, height=90)b2 = Tk.Button(app1, text="女生宿舍", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b2.place(x=40, y=260, width=200, height=90)b3 = Tk.Button(app1, text="请假学生", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b3.place(x=40, y=370, width=200, height=90)b4 = Tk.Button(app1, text="主菜单", font=("SimKai", 15, "bold"), command=f1_fig(bg="gray", width=200)b4.place(x=40, y=480, width=200, height=90)
def f1_12_21l1():f1_12_21l(1)
def f1_12_21l2():f1_12_21l(2)
def f1_12_21l(t):tt=""&#()text=["姓名  性别 住址 班级 入住情况n"]text1=""h=1if(t==1):for i in Boydormitory:for j in i:if tt in j and len(tt)>0:text.append(j)h=0if h==1:l1.delete(0, Tk.END)text1="该座公寓查无此人!!!!!!!!"l1.insert(Tk.END,text1)l1.place(x=380, y=260, width=400, height=260)s1.place(x=380, y=260, width=400, height=260)else:l1.delete(0,Tk.END)for g in text:l1.insert(Tk.END,g)l1.place(x=380, y=260, width=400, height=260)s1.place(x=380, y=260, width=400, height=260)else:for i in Femaledormitory:for j in i:if tt in j and len(tt)>0:text.append(j)h=0if h==1:l1.delete(0, Tk.END)text1 = "该座公寓查无此人!!!!!!!!"l1.insert(Tk.END,text1)l1.place(x=380, y=260, width=400, height=260)s1.place(x=380, y=260, width=400, height=260)else:l1.delete(0,Tk.END)for g in text:l1.insert(Tk.END,g)l1.place(x=380, y=260, width=400, height=260)s1.place(x=380, y=260, width=400, height=260)
#***********************************************************************************************************************
def f2():app.destroy()global app2app2 = Tk.Tk()app2.update()ry('800x600')app2.title("学生入住系统")fig(bg="gray")m = Tk.Message(app2, text="学生入住系统", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)t1 = " 寝室公约1n  1、早晨起床轻手轻脚,不要制造声响。n  2、每天的值日生必须按时将宿舍打扫干净,及时处理垃圾。n3、电脑音响开到自己能听见即可,戴上耳机更好。n  4、个人物品放在各自的橱柜里,不得乱扔,更不要随便占领别人的地盘。n5、卧谈会时间不宜过长,适可而止,最晚12点睡觉。n  6、进出请随手关门。n  7、未经允许,不要乱拿他人的东西。n8、搞好个人卫生,勤洗衣服勤洗澡。n  9、在宿舍有大声唱歌、抽烟、打呼噜等特殊嗜好者,除非其他人都欣赏,否则请慢慢改掉。n10、最后一个离开宿舍者,关好窗子锁好门。n"m2 = Tk.Message(app2, text=t1, font=("SimKai", 15, "bold"))m2.config(bg="gray", width=400)m2.place(x=380, y=70, width=400, height=520)b1 = Tk.Button(app2, text="男生宿舍", font=("SimKai", 15, "bold"), command=f2_fig(bg="gray", width=200)b1.place(x=40, y=150, width=200, height=90)b2 = Tk.Button(app2, text="女生宿舍", font=("SimKai", 15, "bold"), command=f2_fig(bg="gray", width=200)b2.place(x=40, y=260, width=200, height=90)b3 = Tk.Button(app2, text="主菜单", font=("SimKai", 15, "bold"), command=f2_fig(bg="gray", width=200)b3.place(x=40, y=370, width=200, height=90)
#***********************************************************************************************************************
def f2_(t):if t==1:t1="男生宿舍入住系统"else:t1="女生宿舍入住系统"app2.destroy()global app21,l11,l12,e11,e12,e13,e14,e15,e16,e21,e22,e23,e24,e25,e26,e31,e32,e34,e35,e36,m111,m112,e33app21 = Tk.Tk()app21.update()ry('800x600')app21.title(fig(bg="gray")m = Tk.Message(app21, text=t1, font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)m2 = Tk.Message(app21, text="信息修改", font=("SimKai", 20, "bold"))m2.config(bg="gray", width=200)m2.place(x=540, y=70, width=200, height=40)m3 = Tk.Message(app21, text="学生入住", font=("SimKai", 20, "bold"))m3.config(bg="gray", width=200)m3.place(x=50, y=70, width=200, height=40)b1 = Tk.Button(app21, text="上级菜单", font=("SimKai", 15, "bold"), command=f2_fig(bg="gray", width=200)b1.place(x=560, y=530, width=200, height=35)b2 = Tk.Button(app21, text="主菜单", font=("SimKai", 15, "bold"), command=f2_fig(bg="gray", width=200)b2.place(x=40, y=530, width=200, height=35)m11 = Tk.Message(app21, text="姓名", font=("SimKai", 15, "bold"))fig(bg="gray",width=100)m11.place(x=20,y=150,width=100,height=30)e11=Tk.Entry(app21,font=("SimKai", 15, "bold"))fig(bg="gray",width=100)e11.place(x=130,y=150,width=100,height=30)m21 = Tk.Message(app21, text="原姓名", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m21.place(x=330, y=150, width=100, height=30)e21 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e21.place(x=430, y=150, width=100, height=30)m31 = Tk.Message(app21, text="新姓名", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m31.place(x=570, y=150, width=100, height=30)e31 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e31.place(x=670, y=150, width=100, height=30)m12 = Tk.Message(app21, text="性别", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m12.place(x=20, y=190, width=100, height=30)e12 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e12.place(x=130, y=190, width=100, height=30)m22 = Tk.Message(app21, text="原性别", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m22.place(x=330, y=190, width=100, height=30)e22 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e22.place(x=430, y=190, width=100, height=30)m32 = Tk.Message(app21, text="新性别", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m32.place(x=570, y=190, width=100, height=30)e32 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e32.place(x=670, y=190, width=100, height=30)m13 = Tk.Message(app21, text="宿舍", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m13.place(x=20, y=230, width=100, height=30)e13 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e13.place(x=130, y=230, width=100, height=30)m23 = Tk.Message(app21, text="原宿舍", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m23.place(x=330, y=230, width=100, height=30)e23 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e23.place(x=430, y=230, width=100, height=30)m33 = Tk.Message(app21, text="新宿舍", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m33.place(x=570, y=230, width=100, height=30)e33 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e33.place(x=670, y=230, width=100, height=30)m14 = Tk.Message(app21, text="床号", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m14.place(x=20, y=270, width=100, height=30)e14 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e14.place(x=130, y=270, width=100, height=30)m24 = Tk.Message(app21, text="原床号", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m24.place(x=330, y=270, width=100, height=30)e24 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e24.place(x=430, y=270, width=100, height=30)m34 = Tk.Message(app21, text="新床号", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m34.place(x=570, y=270, width=100, height=30)e34 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e34.place(x=670, y=270, width=100, height=30)m15 = Tk.Message(app21, text="班级", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m15.place(x=20, y=310, width=100, height=30)e15 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e15.place(x=130, y=310, width=100, height=30)m25 = Tk.Message(app21, text="原班级", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m25.place(x=330, y=310, width=100, height=30)e25 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e25.place(x=430, y=310, width=100, height=30)m35 = Tk.Message(app21, text="新班级", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m35.place(x=570, y=310, width=100, height=30)e35 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e35.place(x=670, y=310, width=100, height=30)m16 = Tk.Message(app21, text="入住情况", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m16.place(x=20, y=350, width=100, height=30)e16 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e16.place(x=130, y=350, width=100, height=30)m26 = Tk.Message(app21, text="原入住情况", font=("SimKai", 13, "bold"))fig(bg="gray", width=100)m26.place(x=330, y=350, width=100, height=30)e26 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e26.place(x=430, y=350, width=100, height=30)m36 = Tk.Message(app21, text="新入住情况", font=("SimKai", 13, "bold"))fig(bg="gray", width=100)m36.place(x=570, y=350, width=100, height=30)e36 = Tk.Entry(app21, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e36.place(x=670, y=350, width=100, height=30)if t==1:b3 = Tk.Button(app21, text="确认入住",command=f61)b4 = Tk.Button(app21, text="确认修改",command=f71)else:b3 = Tk.Button(app21, text="确认入住",command=f62)b4 = Tk.Button(app21, text="确认修改",command=fig(bg="gray",font=("SimKai", 15, "bold"),width=100)b3.place(x=20, y=430, width=100, height=30)m111=Tk.Message(app21,text="",font=("SimKai", 13, "bold"))fig(bg="white",width=100)m111.place(x=130, y=400, width=100, height=fig(bg="gray", font=("SimKai", 15, "bold"), width=100)b4.place(x=320, y=430, width=100, height=30)m112 = Tk.Message(app21, text="",font=("SimKai", 13, "bold"))fig(bg="white", width=100)m112.place(x=430, y=400, width=350, height=100)
#***********************************************************************************************************************
def f61():f6(1)
def f62():f6(2)
def f6(t):text1=""&#()+"  "&#()+"   "&#()+"-"&#()+"  "&#()+"  "&#()+"n"text2 = "" + ()text3=""&#()t1=""&#()+"-"&#()()!="" ()!="":index = ()) - 1if t == 1:if ()) <= 6 and ()) <= 6 and ()) == ()) and ()) == ()) and ()) >= 1 and ()) >=1:h1 = 0h2 = 0for i in Boydormitory[index]:if t1 in i:h1 = 1breakfor i in Boydormitory:for j in i:if text2 in j and text3 in j:h2 = () == "" () == "" () == "" () == "" () == "" () == "":fig(text="请输入完整信息!!!")() !="男" ()!="女":fig(text="性别有误!!!")() !="请假" ()!="在校":fig(text="入住情况有误!!!")() == "女":fig(text= "男生宿舍!!!")elif len(Boydormitory[index]) >= fig(text= "该宿舍已满!!!")elif h1 == fig(text= "该床位号已有人!!!")elif h2 == fig(text= "该学生已经入住宿舍!!!")else:t2 = "" + () + "同学成功入住宿舍!!!&#fig(text=t2)Boydormitory[index].append(text1)fig(text= "请输入正确的住址!!!")else:if ()) <= 6 and ()) <= 6 and ()) == ()) and ()) == ()) and ()) >= 1 and ()) >=1:h1 = 0h2 = 0for i in Femaledormitory[index]:if t1 in i:h1 = 1breakfor i in Femaledormitory:for j in i:if text2 in j and text3 in j:h2 = () == "" () == "" () == "" () == "" () == "" () == "":fig(text= "请输入完整信息!!!")() !="男" ()!="女":fig(text="性别有误!!!")() !="请假" ()!="在校":fig(text="入住情况有误!!!")() == "男":fig(text= "女生宿舍!!!")elif len(Femaledormitory[index]) >= fig(text= "该宿舍已满!!!")elif h1 == fig(text="该床位号已有人!!!")elif h2 == fig(text="该学生已经入住宿舍!!!")else:t2 = "" + () + "同学成功入住宿舍!!!&#fig(text=t2)Femaledormitory[index].append(text1)fig(text="请输入正确的住址!!!")fig(text="请输入正确的住址!!!")#***********************************************************************************************************************
def f71():f7(1)
def f72():f7(2)
def f7(t):text1 = "" + () + "  " + () + "   " + () + "-" + () + "  " + () + "  " + () + "n"text2 = "" + () + "  " + () + "   " + () + "-" + () + "  " + ()text12 = "" + ()text3 = "" + ()t1 = "" + () + "-" + ()text11 = "" + () + "  " + () + "   " + () + "-" + () + "  " + () + "  " + () + "n"text21 = "" + () + "  " + () + "   " + () + "-" + () + "  " + ()text121 = "" + ()text31 = "" + ()t11 = "" + () + "-" + ()()!="" ()!="":index1 = ()) - 1if t == 1:if ()) <= 6 and ()) <= 6 and ()) == ()) and ()) == ()) and ()) >= 1 and ()) >=1:h2 = 0for i in Boydormitory:for j in i:if text2 in j:h2 = () == "" () == "" () == "" () == "" () == "" () == "":fig(text="请输入完整信息!!!")() != "男" () != "女":fig(text="性别有误!!!")() != "请假" () != "在校":fig(text="入住情况有误!!!")elif h2 != fig(text= "该学生未入住宿舍或信息错误!!!")else:() != "" () != "":index2 = ()) - 1if t == 1:if ()) <= 6 and ()) <= 6 and ()) == ()) and ()) == ()) and ()) >= 1 and ()) >= 1:h1 = 0for i in Boydormitory[index2]:if t11 in i:h1 = () == "" () == "" () == "" () == "" () == "" () == "":fig(text="请输入完整信息!!!")() != "男" () != "女":fig(text="性别有误!!!")() != "请假" () != "在校":fig(text="入住情况有误!!!")() == "女":fig(text="男生宿舍!!!")elif len(Boydormitory[index2]) >= fig(text="该宿舍已满!!!")elif h1 == fig(text="该床位号已有人!!!")else:if t1 != t11:for i in Boydormitory[index1]:if text2 in i:Boydormitory[index1].remove(i)Boydormitory[index2].append(text11)else:for i in Boydormitory:for j in i:if text1 in j :j=text11breakt2 = "" + () + "同学信息成功修改!!!&#fig(text=t2)fig(text="请输入正确的住址!!!")fig(text= "请输入正确的住址!!!")else:if ()) <= 6 and ()) <= 6 and ()) == ()) and ()) == ()) and ()) >= 1 and ()) >= 1:h2 = 0for i in Femaledormitory:for j in i:if text2 in j:h2 = () == "" () == "" () == "" () == "" () == "" () == "":fig(text="请输入完整信息!!!")() != "男" () != "女":fig(text="性别有误!!!")() != "请假" () != "在校":fig(text="入住情况有误!!!")elif h2 != fig(text="该学生未入住宿舍或信息错误!!!")else:() != "" () != "":index2 = ()) - 1if ()) <= 6 and ()) <= 6 and ()) == ()) and ()) == ()) and ()) >= 1 and ()) >= 1:h1 = 0for i in Femaledormitory[index2]:if t11 in i:h1 = () == "" () == "" () == "" () == "" () == "" () == "":fig(text="请输入完整信息!!!")() != "男" () != "女":fig(text="性别有误!!!")() != "请假" () != "在校":fig(text="入住情况有误!!!")() == "男":fig(text="女生宿舍!!!")elif len(Femaledormitory[index2]) >= fig(text="该宿舍已满!!!")elif h1 == fig(text="该床位号已有人!!!")else:if t1 != t11:for i in Femaledormitory[index1]:if text2 in i:Femaledormitory[index1].remove(i)Femaledormitory[index2].append(text11)else:for i in Femaledormitory:for j in i:if text1 in j:j = text11breakt2 = "" + () + "同学信息成功修改!!!&#fig(text=t2)fig(text="请输入正确的住址!!!")fig(text="请输入正确的住址!!!")fig(text="请输入正确的住址!!!")
#***********************************************************************************************************************
def f2_1():f2_(1)
def f2_2():f2_(2)
def f2_3():f1_3(app2)
def f2_12():f1_3(app21)
#***********************************************************************************************************************
def f2_2_(t):t.destroy()global app2app2 = Tk.Tk()app2.update()ry('800x600')app2.title("学生入住系统")fig(bg="gray")m = Tk.Message(app2, text="学生入住系统", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)t1 = " 寝室公约1n  1、早晨起床轻手轻脚,不要制造声响。n  2、每天的值日生必须按时将宿舍打扫干净,及时处理垃圾。n3、电脑音响开到自己能听见即可,戴上耳机更好。n  4、个人物品放在各自的橱柜里,不得乱扔,更不要随便占领别人的地盘。n5、卧谈会时间不宜过长,适可而止,最晚12点睡觉。n  6、进出请随手关门。n  7、未经允许,不要乱拿他人的东西。n8、搞好个人卫生,勤洗衣服勤洗澡。n  9、在宿舍有大声唱歌、抽烟、打呼噜等特殊嗜好者,除非其他人都欣赏,否则请慢慢改掉。n10、最后一个离开宿舍者,关好窗子锁好门。n"m2 = Tk.Message(app2, text=t1, font=("SimKai", 15, "bold"))m2.config(bg="gray", width=400)m2.place(x=380, y=70, width=400, height=520)b1 = Tk.Button(app2, text="男生宿舍", font=("SimKai", 15, "bold"), command=f2_fig(bg="gray", width=200)b1.place(x=40, y=150, width=200, height=90)b2 = Tk.Button(app2, text="女生宿舍", font=("SimKai", 15, "bold"), command=f2_fig(bg="gray", width=200)b2.place(x=40, y=260, width=200, height=90)b3 = Tk.Button(app2, text="主菜单", font=("SimKai", 15, "bold"), command=f2_fig(bg="gray", width=200)b3.place(x=40, y=370, width=200, height=90)
def f2_11():f2_2_(app21)
def f2_21():f2_2_(app21)
#***********************************************************************************************************************
def f3():app.destroy()global app3, l11, e11, e12, e13, e14, e15, e16, m111app3 = Tk.Tk()app3.update()ry('800x600')app3.title("学生退宿系统")fig(bg="gray")m = Tk.Message(app3, text="学生退宿系统", font=("SimKai", 30, "bold"))m.config(bg="gray", width=400)m.place(x=0, y=20, width=800, height=60)m11 = Tk.Message(app3, text="姓名", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m11.place(x=20, y=150, width=100, height=30)e11 = Tk.Entry(app3, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e11.place(x=130, y=150, width=100, height=30)m12 = Tk.Message(app3, text="性别", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m12.place(x=20, y=190, width=100, height=30)e12 = Tk.Entry(app3, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e12.place(x=130, y=190, width=100, height=30)m13 = Tk.Message(app3, text="宿舍", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m13.place(x=20, y=230, width=100, height=30)e13 = Tk.Entry(app3, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e13.place(x=130, y=230, width=100, height=30)m14 = Tk.Message(app3, text="床号", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m14.place(x=20, y=270, width=100, height=30)e14 = Tk.Entry(app3, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e14.place(x=130, y=270, width=100, height=30)m15 = Tk.Message(app3, text="班级", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m15.place(x=20, y=310, width=100, height=30)e15 = Tk.Entry(app3, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e15.place(x=130, y=310, width=100, height=30)m16 = Tk.Message(app3, text="入住情况", font=("SimKai", 15, "bold"))fig(bg="gray", width=100)m16.place(x=20, y=350, width=100, height=30)e16 = Tk.Entry(app3, font=("SimKai", 15, "bold"))fig(bg="gray", width=100)e16.place(x=130, y=350, width=100, height=30)t1 = " 寝室公约1n  1、早晨起床轻手轻脚,不要制造声响。n  2、每天的值日生必须按时将宿舍打扫干净,及时处理垃圾。n3、电脑音响开到自己能听见即可,戴上耳机更好。n  4、个人物品放在各自的橱柜里,不得乱扔,更不要随便占领别人的地盘。n5、卧谈会时间不宜过长,适可而止,最晚12点睡觉。n  6、进出请随手关门。n  7、未经允许,不要乱拿他人的东西。n8、搞好个人卫生,勤洗衣服勤洗澡。n  9、在宿舍有大声唱歌、抽烟、打呼噜等特殊嗜好者,除非其他人都欣赏,否则请慢慢改掉。n10、最后一个离开宿舍者,关好窗子锁好门。n"m2 = Tk.Message(app3, text=t1, font=("SimKai", 15, "bold"))m2.config(bg="gray", width=400)m2.place(x=380, y=70, width=400, height=520)b1 = Tk.Button(app3, text="确认删除", command=fig(bg="gray", font=("SimKai", 15, "bold"), width=100)b1.place(x=20, y=430, width=100, height=30)m111 = Tk.Message(app3, text="", font=("SimKai", 13, "bold"))fig(bg="white", width=100)m111.place(x=130, y=400, width=100, height=80)b2 = Tk.Button(app3, text="主菜单", font=("SimKai", 15, "bold"), command=fig(bg="gray", width=210)b2.place(x=20, y=500, width=210, height=50)
def f8():f1_3(app3)
def f81():text2 = "" + () + "  " + () + "   " + () + "-" + () + "  " + ()index = ()) - 1text2=""&#()if text2=="男":() == "" () == "" () == "" () == "" () == "" () == "":fig(text="请输入完整信息!!!")() != "男" () != "女":fig(text="性别有误!!!")() != "请假" () != "在校":fig(text="入住情况有误!!!")else:h1 = 0for i in Boydormitory[index]:if text2 in i:h1 = 1Boydormitory[index].remove(i)breakif h1 == fig(text="删除成功!!!")fig(text="无该信息!!!")else:() == "" () == "" () == "" () == "" () == "" () == "":fig(text="请输入完整信息!!!")() != "男" () != "女":fig(text="性别有误!!!")() != "请假" () != "在校":fig(text="入住情况有误!!!")else:h1 = 0for i in Femaledormitory[index]:if text2 in i:h1 = 1Femaledormitory[index].remove(i)breakif h1 == fig(text="删除成功!!!")fig(text="无该信息!!!")
#***********************************************************************************************************************global one,two,three,four,five,six,gone,gtwo,gthree,gfour,gfive,gsix,Boudormitory,Femaledormitory
one=["姓名 性别 住址 班级 入住情况n","赵一  男   1-1  221  在校n","孔一  男   1-2  221  在校n"]
two=["姓名 性别 住址 班级 入住情况n","张三  男   2-1  231  在校n"]
three=["姓名 性别 住址 班级 入住情况n","李四  男   3-1  231  在校n"]
four=["姓名 性别 住址 班级 入住情况n","程五  男   4-1  211  请假n"]
five=["姓名 性别 住址 班级 入住情况n","王六  男   5-1  221  在校n"]
six=["姓名 性别 住址 班级 入住情况n","成七  男   6-1  221  在校n"]
Boydormitory=[one,two,three,four,five,six]
gone=["姓名 性别 住址 班级 入住情况n","陈一  女   1-1  221  在校n"]
gtwo=["姓名 性别 住址 班级 入住情况n","钱三  女   2-1  231  请假n"]
gthree=["姓名 性别 住址 班级 入住情况n","艾四  女   3-1  231  在校n"]
gfour=["姓名 性别 住址 班级 入住情况n","罗五  女   4-1  211  请假n"]
gfive=["姓名 性别 住址 班级 入住情况n","南六  女   5-1  221  在校n"]
gsix=["姓名 性别 住址 班级 入住情况n","秦七  女   6-1  221  在校n"]
Femaledormitory=[gone,gtwo,gthree,gfour,gfive,gsix]#***********************************************************************************************************************
def f():app.destroy()
app = Tk.Tk()
ry('800x600')
app.title("宿舍管理系统")
fig(bg="gray")
m = Tk.Message(app, text="学生公寓",font=("SimKai",30,"bold"))
m.config(bg="gray",width=200)
m.place(x=0,y=20,width=800,height=60)
t1=" 寝室公约1n  1、早晨起床轻手轻脚,不要制造声响。n  2、每天的值日生必须按时将宿舍打扫干净,及时处理垃圾。n3、电脑音响开到自己能听见即可,戴上耳机更好。n  4、个人物品放在各自的橱柜里,不得乱扔,更不要随便占领别人的地盘。n5、卧谈会时间不宜过长,适可而止,最晚12点睡觉。n  6、进出请随手关门。n  7、未经允许,不要乱拿他人的东西。n8、搞好个人卫生,勤洗衣服勤洗澡。n  9、在宿舍有大声唱歌、抽烟、打呼噜等特殊嗜好者,除非其他人都欣赏,否则请慢慢改掉。n10、最后一个离开宿舍者,关好窗子锁好门。n"
m2=Tk.Message(app,text=t1,font=("SimKai",15,"bold"))
m2.config(bg="gray",width=400)
m2.place(x=380,y=70,width=400,height=520)
b1=Tk.Button(app,text="学生查询",font=("SimKai",15,"bold"),command=f1)
b1.config(bg="gray",width=200)
b1.place(x=40,y=150,width=200,height=90)
b2=Tk.Button(app,text="学生入住",font=("SimKai",15,"bold"),command=f2)
b2.config(bg="gray",width=200)
b2.place(x=40,y=260,width=200,height=90)
b3=Tk.Button(app,text="学生退宿",font=("SimKai",15,"bold"),command=f3)
b3.config(bg="gray",width=200)
b3.place(x=40,y=370,width=200,height=90)
b4=Tk.Button(app,text="退出系统",font=("SimKai",15,"bold"),command=f)
b4.config(bg="gray",width=200)
b4.place(x=40,y=480,width=200,height=90)
app.mainloop()

结果如下:

本文发布于:2024-01-28 08:43:26,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/17064026096196.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:管理系统   学生宿舍   窗口   python   tk
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23