commit 6207a9f4b57d4fc89a3547b73c7f85ef3db89523
Author: sword-demon <2013482345@qq.com>
Date: Fri May 31 17:00:16 2024 +0800
教务管理系统
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..0f6dba6
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..e15ec35
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/pythonProject.iml b/.idea/pythonProject.iml
new file mode 100644
index 0000000..4bf8ccf
--- /dev/null
+++ b/.idea/pythonProject.iml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HumanManages/.idea/.gitignore b/HumanManages/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/HumanManages/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/HumanManages/.idea/HumanManage.iml b/HumanManages/.idea/HumanManage.iml
new file mode 100644
index 0000000..8437fe6
--- /dev/null
+++ b/HumanManages/.idea/HumanManage.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HumanManages/.idea/inspectionProfiles/Project_Default.xml b/HumanManages/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..7df2b6e
--- /dev/null
+++ b/HumanManages/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HumanManages/.idea/inspectionProfiles/profiles_settings.xml b/HumanManages/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/HumanManages/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HumanManages/.idea/misc.xml b/HumanManages/.idea/misc.xml
new file mode 100644
index 0000000..dc9ea49
--- /dev/null
+++ b/HumanManages/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/HumanManages/.idea/modules.xml b/HumanManages/.idea/modules.xml
new file mode 100644
index 0000000..4ed92d3
--- /dev/null
+++ b/HumanManages/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HumanManages/.idea/vcs.xml b/HumanManages/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/HumanManages/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HumanManages/MainPages.py b/HumanManages/MainPages.py
new file mode 100644
index 0000000..97dfd51
--- /dev/null
+++ b/HumanManages/MainPages.py
@@ -0,0 +1,392 @@
+from tkinter import *
+import tkinter.messagebox as mb
+import _sqlite3
+
+import Managerview # 管理员菜单栏对应的各个子页面
+import Teacherview # 教师菜单栏对应的各个子页面
+import Studentview # 学生菜单栏对应的各个子页面
+
+#连接数据库
+# conn = _sqlite3.connect(":memory:")
+conn = _sqlite3.connect("data.db")
+c = conn.cursor()
+
+
+def login_teacher(name):
+ c.execute("select * from teachers where teachers.name = '%s'" % name)
+ # 提交事务
+ conn.commit()
+ return c.fetchall()
+def login_student(name):
+ c.execute("select * from students where students.name = '%s'" % name)
+ # 提交事务
+ conn.commit()
+ return c.fetchall()
+
+#登录窗体
+class LoginPage(object):
+ def __init__(self, master=None):
+ self.root = master # 定义内部变量root
+ self.root.geometry('%dx%d' % (800, 610)) # 设置窗口大小
+ self.usrrole = IntVar()
+ self.usrrole.set(1)
+ self.username = StringVar()
+ self.username.set("admin")
+ self.password = StringVar()
+ self.createPage()
+ def createPage(self):
+ self.page = Frame(self.root) # 创建Frame
+ self.page.pack()
+ Label(self.page).grid(row=0, stick=W)
+ Label(self.page, text="登录角色:").grid(row=1, stick=W, pady=10)
+ Radiobutton(self.page, text="管理员", variable=self.usrrole, value=1, command=self.__setusrstr).grid(row=1, column=1, stick=W)
+ Radiobutton(self.page, text="教师", variable=self.usrrole, value=2, command=self.__setusrstr).grid(row=1, column=2, stick=W)
+ Radiobutton(self.page, text="学生", variable=self.usrrole, value=3, command=self.__setusrstr).grid(row=1, column=3, stick=W)
+ Label(self.page, text='账户: ').grid(row=2, stick=W, pady=10)
+ Entry(self.page, textvariable=self.username).grid(row=2, column=1, columnspan=2, stick=E)
+ Label(self.page, text='密码: ').grid(row=3, stick=W, pady=10)
+ Entry(self.page, textvariable=self.password, show='*').grid(row=3, column=1, columnspan=2, stick=E)
+ Button(self.page, text='登陆', command=self.loginCheck).grid(row=4, columnspan=2, pady=10, stick=W)
+ Button(self.page, text='退出系统', command=self.exitsys).grid(row=4, column=2, columnspan=2, stick=E)
+
+ #判断登录用户
+ def loginCheck(self):
+ role = self.usrrole.get()
+ name = self.username.get()
+ secret = self.password.get()
+ if role == 1 and name == "admin" and secret == "123456":
+ self.page.destroy()
+ self.username.set('')
+ self.password.set('')
+ ManagerPage(name,self.root)
+ mb.showinfo('登录成功', '欢迎:%s' % name)
+ elif role == 2:
+ login = login_teacher(name)
+ if len(login) == 0:
+ mb.showerror("登录失败","账号不存在")
+ pth = login[0]
+ print(pth)
+ if name == pth[1] and secret == pth[0]:
+ self.page.destroy()
+ self.username.set('')
+ self.password.set('')
+ TeacherPage(name,secret, self.root)
+ mb.showinfo('登录成功', '欢迎:%s' % name)
+ else:
+ mb.showinfo(title='错误', message='账号或密码错误!')
+ elif role == 3:
+ login = login_student(name)
+ if len(login) == 0:
+ mb.showerror("登录失败", "账号不存在")
+ pth = login[0]
+ print(pth)
+ if name == pth[1] and secret == pth[0]:
+ self.page.destroy()
+ self.username.set('')
+ self.password.set('')
+ StudentPage(name, self.root)
+ mb.showinfo('登录成功', '欢迎:%s' % name)
+ else:
+ mb.showinfo(title='错误', message='账号或密码错误!')
+ else:
+ mb.showinfo(title='错误', message='账号或密码错误!')
+ self.username.set('')
+ self.password.set('')
+
+
+ def __setusrstr(self):
+ self.username.set("admin")
+ if self.usrrole.get() == 2:
+ self.username.set("请输入工号")
+ elif self.usrrole.get() == 3:
+ self.username.set("请输入学号")
+
+ def exitsys(self):
+ if mb.askyesno("退出系统", "你确定更要退出系统"):
+ self.page.destroy()
+ self.root.destroy()
+
+#管理员窗体
+class ManagerPage(object):
+ def __init__(self, name, master=None):
+ self.root = master # 定义内部变量root
+ self.usrname = name
+ self.root.geometry('%dx%d' % (600, 400)) # 设置窗口大小
+ self.createPage()
+ #菜单栏
+ def createPage(self):
+ self.WelcomePage = Managerview.WelcomeFrame(self.usrname,self.root) # 创建不同Frame
+ self.inputTeacherPage = Managerview.InputTeacherFrame(self.root)
+ self.inputstudentPage = Managerview.InputStudentFrame(self.root)
+ self.queryPage = Managerview.QueryFrame(self.root)
+ self.maintainPage = Managerview.maintainFrame(self.root)
+ self.UpdateKeywordPage = Managerview.UpdateKeywordFrame(self.root)
+ self.WelcomePage.pack() # 默认显示欢迎界面
+ menubar = Menu(self.root)
+ self.menubar = menubar
+ menu1 = Menu(self.root)
+ menu1.add_command(label="创建教师账号", command=self.CreateTeacher)
+ menu1.add_command(label="创建学生账号", command=self.CreateStudent)
+ menu1.add_command(label="修改管理员密码", command=self.UpdateKeyword)
+ menubar.add_cascade(label='账户权限管理', menu=menu1)
+ menubar.add_command(label='信息查询', command=self.queryData)
+ menubar.add_command(label='信息维护', command=self.maintain)
+ menubar.add_command(label='退出登录', command=self.returnLogin)
+ self.root['menu'] = menubar # 设置菜单栏
+
+ def UpdateKeyword(self):
+ self.WelcomePage.pack_forget()
+ self.inputTeacherPage.pack_forget()
+ self.inputstudentPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.maintainPage.pack_forget()
+ self.UpdateKeywordPage.pack()
+
+ def CreateTeacher(self):
+ self.WelcomePage.pack_forget()
+ self.inputTeacherPage.pack()
+ self.inputstudentPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.maintainPage.pack_forget()
+ self.UpdateKeywordPage.pack_forget()
+
+ def queryData(self):
+ self.WelcomePage.pack_forget()
+ self.inputTeacherPage.pack_forget()
+ self.inputstudentPage.pack_forget()
+ self.queryPage.pack()
+ self.maintainPage.pack_forget()
+ self.UpdateKeywordPage.pack_forget()
+
+ def maintain(self):
+ self.WelcomePage.pack_forget()
+ self.inputTeacherPage.pack_forget()
+ self.inputstudentPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.maintainPage.pack()
+ self.UpdateKeywordPage.pack_forget()
+
+ def CreateStudent(self):
+ self.WelcomePage.pack_forget()
+ self.inputTeacherPage.pack_forget()
+ self.inputstudentPage.pack()
+ self.queryPage.pack_forget()
+ self.maintainPage.pack_forget()
+ self.UpdateKeywordPage.pack_forget()
+ def returnLogin(self):
+ self.WelcomePage.destroy()
+ self.inputTeacherPage.destroy()
+ self.inputstudentPage.destroy()
+ self.queryPage.destroy()
+ self.maintainPage.destroy()
+ self.UpdateKeywordPage.destroy()
+ self.menubar.destroy()
+ LoginPage(self.root)
+#老师窗体类
+class TeacherPage(object):
+ def __init__(self, name,secret, master=None):
+ self.usrname = name
+ self.password = secret
+ self.root = master # 定义内部变量root
+ self.root.geometry('%dx%d' % (600, 500)) # 设置窗口大小
+ self.createPage()
+
+ def createPage(self):
+ self.WelcomePage = Teacherview.WelcomeFrame(self.usrname, self.root) # 创建欢迎界面
+ self.myPage = Teacherview.MyFrame(self.usrname,self.root)
+ self.updatepwdPage = Teacherview.UpdatepwdFrame(self.usrname,self.root)
+ self.inputPage = Teacherview.InputFrame(self.root) # 创建不同Frame
+ self.queryPage = Teacherview.QueryFrame(self.root)
+ self.countPage = Teacherview.CountFrame(self.root)
+ self.count2Page = Teacherview.EditFrame(self.root)
+ self.feedbackPage = Teacherview.FeedbackFrame(self.root)
+ self.WelcomePage.pack() # 默认显示欢迎界面
+ menubar = Menu(self.root)
+ self.menubar = menubar
+ menu1 = Menu(self.root)
+ menu1.add_command(label='个人信息', command=self.myData)
+ menu1.add_command(label='修改密码', command=self.updatepwdData)
+ menubar.add_cascade(label='我的', menu=menu1)
+ menubar.add_command(label='成绩录入', command=self.inputData)
+ menubar.add_command(label='查询', command=self.queryData)
+ menubar.add_command(label='统计', command=self.countData)
+ menubar.add_command(label='编辑', command=self.count2Data)
+ menubar.add_command(label='意见反馈', command=self.feedbackData)
+ menubar.add_command(label= "教师"+self.usrname + '已登录,退出登录', command=self.returnLogin)
+ self.root['menu'] = menubar # 设置菜单栏
+
+ def myData(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.feedbackPage.pack_forget()
+ self.count2Page.pack_forget()
+ self.myPage.pack()
+ self.updatepwdPage.pack_forget()
+ self.WelcomePage.pack_forget()
+
+ def updatepwdData(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.feedbackPage.pack_forget()
+ self.count2Page.pack_forget()
+ self.myPage.pack_forget()
+ self.updatepwdPage.pack()
+ self.WelcomePage.pack_forget()
+
+ def inputData(self):
+ self.inputPage.pack()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.feedbackPage.pack_forget()
+ self.count2Page.pack_forget()
+ self.myPage.pack_forget()
+ self.updatepwdPage.pack_forget()
+ self.WelcomePage.pack_forget()
+
+ def queryData(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack()
+ self.countPage.pack_forget()
+ self.feedbackPage.pack_forget()
+ self.count2Page.pack_forget()
+ self.myPage.pack_forget()
+ self.updatepwdPage.pack_forget()
+ self.WelcomePage.pack_forget()
+
+ def countData(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.countPage.pack()
+ self.feedbackPage.pack_forget()
+ self.count2Page.pack_forget()
+ self.myPage.pack_forget()
+ self.updatepwdPage.pack_forget()
+ self.WelcomePage.pack_forget()
+
+ def count2Data(self):
+ self.count2Page.pack()
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.feedbackPage.pack_forget()
+ self.myPage.pack_forget()
+ self.updatepwdPage.pack_forget()
+ self.WelcomePage.pack_forget()
+
+ def feedbackData(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.feedbackPage.pack()
+ self.count2Page.pack_forget()
+ self.myPage.pack_forget()
+ self.updatepwdPage.pack_forget()
+ self.WelcomePage.pack_forget()
+
+ def returnLogin(self):
+ self.inputPage.destroy()
+ self.queryPage.destroy()
+ self.countPage.destroy()
+ self.menubar.destroy()
+ self.feedbackPage.destroy()
+ self.count2Page.destroy()
+ self.myPage.destroy()
+ self.updatepwdPage.destroy()
+ self.WelcomePage.destroy()
+ LoginPage(self.root)
+#学生窗体类
+class StudentPage(object):
+ def __init__(self, name, master=None):
+ self.usrname = name
+ self.root = master # 定义内部变量root
+ self.root.geometry('%dx%d' % (600, 500)) # 设置窗口大小
+ self.createPage()
+
+ def createPage(self):
+ self.myPage2 = Studentview.MyFrame(self.usrname, self.root)
+ self.updatepwdPage2 = Studentview.UpdatepwdFrame(self.usrname, self.root)
+ self.inputPage = Studentview.InputFrame(self.root) # 创建不同Frame
+ self.queryPage = Studentview.QueryFrame(self.root)
+ self.countPage = Studentview.CountFrame(self.root)
+ self.submitPage = Studentview.SubmitFrame(self.root)
+ self.inputPage.pack() # 默认显示主界面
+ menubar = Menu(self.root)
+ self.menubar = menubar
+ menu1 = Menu(self.root)
+ menu1.add_command(label='个人信息', command=self.myData2)
+ menu1.add_command(label='修改密码', command=self.updatepwdData2)
+ menubar.add_cascade(label='主页', menu=menu1)
+ # menubar.add_command(label='主页', command=self.inputData)
+ menubar.add_command(label='查询成绩', command=self.queryData)
+ menubar.add_command(label='意见反馈', command=self.countData)
+ menubar.add_command(label='提交作业', command=self.submitData)
+ menubar.add_command(label= "学生"+self.usrname + '已登录,退出登录', command=self.returnLogin)
+ self.root['menu'] = menubar # 设置菜单栏
+
+ def updatepwdData2(self):
+ self.updatepwdPage2.pack()
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.submitPage.pack_forget()
+ self.myPage2.pack_forget()
+
+ def myData2(self):
+ self.myPage2.pack()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.submitPage.pack_forget()
+ self.inputPage.pack_forget()
+ self.updatepwdPage2.pack_forget()
+
+ def inputData(self):
+ self.inputPage.pack()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.submitPage.pack_forget()
+ self.myPage2.pack_forget()
+ self.updatepwdPage2.pack_forget()
+
+ def queryData(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack()
+ self.countPage.pack_forget()
+ self.submitPage.pack_forget()
+ self.myPage2.pack_forget()
+ self.updatepwdPage2.pack_forget()
+
+ def countData(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.submitPage.pack_forget()
+ self.countPage.pack()
+ self.myPage2.pack_forget()
+ self.updatepwdPage2.pack_forget()
+
+ def submitData(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.submitPage.pack()
+ self.myPage2.pack_forget()
+ self.updatepwdPage2.pack_forget()
+
+ def aboutDisp(self):
+ self.inputPage.pack_forget()
+ self.queryPage.pack_forget()
+ self.countPage.pack_forget()
+ self.submitPage.pack_forget()
+ self.myPage2.pack_forget()
+ self.updatepwdPage2.pack_forget()
+
+ def returnLogin(self):
+ self.myPage2.destroy()
+ self.updatepwdPage2.destroy()
+ self.inputPage.destroy()
+ self.queryPage.destroy()
+ self.countPage.destroy()
+ self.submitPage.destroy()
+ self.menubar.destroy()
+ LoginPage(self.root)
\ No newline at end of file
diff --git a/HumanManages/Managerview.py b/HumanManages/Managerview.py
new file mode 100644
index 0000000..9bddde1
--- /dev/null
+++ b/HumanManages/Managerview.py
@@ -0,0 +1,470 @@
+import tkinter
+from tkinter import *
+import tkinter.messagebox as mb
+import _sqlite3
+
+# 数据库
+# conn = _sqlite3.connect(":memory:")
+#连接数据库data.db
+conn = _sqlite3.connect("data.db")
+c = conn.cursor()
+#创建表teachers
+# c.execute("create table teachers(id char(20),name char(10),"
+# "sex char(10),speciality char(20),Title char(20),date char(20))")
+#创建表students
+# c.execute("create table students(id char(20),name char(10),"
+# "sex char(10),speciality char(20),classno char(20),date char(20))")
+#添加教师sql语句
+def Insert(id, name, sex, speciality, Title, date):
+ c.execute('insert into teachers values(?,?,?,?,?,?)', (id, name, sex, speciality, Title, date))
+ # 提交事务
+ conn.commit()
+#添加学生sql语句
+def InsertStudent(id, name, sex, speciality, classno, date):
+ c.execute('insert into students values(?,?,?,?,?,?)', (id, name, sex, speciality, classno, date))
+ # 提交事务
+ conn.commit()
+#删除教师sql语句
+def Del(id):
+ c.execute("delete from teachers where id = '%s'" % id)
+ # 提交事务
+ conn.commit()
+#删除学生sql语句
+def DelStudent(id):
+ c.execute("delete from students where id = '%s'" % id)
+ # 提交事务
+ conn.commit()
+#修改教师sql语句
+def Update(id, name, sex, speciality, Title, date):
+ c.execute('update teachers set name = (?),sex = (?),speciality = (?),Title = (?),date = (?) where id = (?)',
+ (name, sex, speciality, Title, date, id))
+ # 提交事务
+ conn.commit()
+#修改学生sql语句
+def UpdateStudent(id, name, sex, speciality, classno, date):
+ c.execute('update students set name = (?),sex = (?),speciality = (?),classno = (?),date = (?) where id = (?)',
+ (name, sex, speciality, classno, date, id))
+ # 提交事务
+ conn.commit()
+#查询教师sql语句
+def Serch():
+ c.execute('select * from teachers')
+ li = c.fetchall()
+ return li
+#查询学生sql语句
+def SerchStudent():
+ c.execute('select * from students')
+ li = c.fetchall()
+ return li
+#根据id查询教师sql语句
+def Serchone(id):
+ c.execute("select * from teachers where teachers.id = '%s'" % id)
+ return c.fetchall()
+#根据id查询学生sql语句
+def SerchoneStudent(id):
+ c.execute("select * from students where students.id = '%s'" % id)
+ return c.fetchall()
+
+#主窗体
+class WelcomeFrame(Frame): # 继承Frame类
+ def __init__(self, name, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.usrname = name
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='欢迎管理员'+self.usrname+'登录', font=("黑体", 20)).pack()
+
+#添加教师类
+class InputTeacherFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.id = StringVar()
+ self.name = StringVar()
+ self.sex = StringVar()
+ self.speciality = StringVar()
+ self.Title = StringVar()
+ self.date = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Label(self).grid(row=0, stick=W, pady=10)
+ Label(self, text='工号: ').grid(row=1, stick=W, pady=10)
+ Entry(self, textvariable=self.id).grid(row=1, column=1, stick=E)
+ Label(self, text='姓名: ').grid(row=2, stick=W, pady=10)
+ Entry(self, textvariable=self.name).grid(row=2, column=1, stick=E)
+ Label(self, text='性别: ').grid(row=3, stick=W, pady=10)
+ Entry(self, textvariable=self.sex).grid(row=3, column=1, stick=E)
+ Label(self, text='专业: ').grid(row=4, stick=W, pady=10)
+ Entry(self, textvariable=self.speciality).grid(row=4, column=1, stick=E)
+ Label(self, text='职称: ').grid(row=5, stick=W, pady=10)
+ Entry(self, textvariable=self.Title).grid(row=5, column=1, stick=E)
+ Label(self, text='入职年月: ').grid(row=6, stick=W, pady=10)
+ Entry(self, textvariable=self.date).grid(row=6, column=1, stick=E)
+ Button(self, text='创建教师账号', command=self.AddTeacher).grid(row=8, column=1, stick=E, pady=10)
+ #添加教师信息
+ def AddTeacher(self):
+ id = self.id.get()
+ name = self.name.get()
+ sex = self.sex.get()
+ speciality = self.speciality.get()
+ Title = self.Title.get()
+ date = self.date.get()
+ if id == '' or name == '':
+ mb.showerror("错误", "信息不能为空!")
+ else:
+ Insert(id,name,sex,speciality,Title,date)
+ mb.showinfo("成功", "新增教师信息成功")
+ self.id.set('')
+ self.name.set('')
+ self.sex.set('')
+ self.speciality.set('')
+ self.Title.set('')
+ self.date.set('')
+
+#添加学生类
+class InputStudentFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.id = StringVar()
+ self.name = StringVar()
+ self.sex = StringVar()
+ self.speciality = StringVar()
+ self.classno = StringVar()
+ self.date = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Label(self).grid(row=0, stick=W, pady=10)
+ Label(self, text='学号: ').grid(row=1, stick=W, pady=10)
+ Entry(self, textvariable=self.id).grid(row=1, column=1, stick=E)
+ Label(self, text='姓名: ').grid(row=2, stick=W, pady=10)
+ Entry(self, textvariable=self.name).grid(row=2, column=1, stick=E)
+ Label(self, text='性别: ').grid(row=3, stick=W, pady=10)
+ Entry(self, textvariable=self.sex).grid(row=3, column=1, stick=E)
+ Label(self, text='专业: ').grid(row=4, stick=W, pady=10)
+ Entry(self, textvariable=self.speciality).grid(row=4, column=1, stick=E)
+ Label(self, text='班级: ').grid(row=5, stick=W, pady=10)
+ Entry(self, textvariable=self.classno).grid(row=5, column=1, stick=E)
+ Label(self, text='入学时间: ').grid(row=6, stick=W, pady=10)
+ Entry(self, textvariable=self.date).grid(row=6, column=1, stick=E)
+ Button(self, text='创建学生账号', command=self.AddStudent).grid(row=8, column=1, stick=E, pady=10)
+ #添加学生信息
+ def AddStudent(self):
+ id = self.id.get()
+ name = self.name.get()
+ sex = self.sex.get()
+ speciality = self.speciality.get()
+ classno = self.classno.get()
+ date = self.date.get()
+ if id == '' or name == '':
+ mb.showerror("错误", "信息不能为空!")
+ else:
+ InsertStudent(id,name,sex,speciality,classno,date)
+ mb.showinfo("成功", "新增学生信息成功")
+ self.id.set('')
+ self.name.set('')
+ self.sex.set('')
+ self.speciality.set('')
+ self.classno.set('')
+ self.date.set('')
+
+#查询操作类
+class QueryFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.itemName = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='查询界面', font=('华文行楷', 20), fg='purple').pack()
+ Button(self, text='查询教师', command=self.show_teacher_frame).pack(anchor='center', pady=5)
+ Button(self, text='查询学生', command=self.show_student_frame).pack(anchor='center', pady=5)
+ #查询教师信息
+ def show_teacher_frame(self):
+ win2 = tkinter.Toplevel()
+ win2.title('查询教师信息')
+ win2.geometry('700x300')
+ sw = win2.winfo_screenwidth()
+ sh = win2.winfo_screenheight()
+ win2.geometry('+%d+%d' % ((sw - 500) / 2, (sh - 300) / 2))
+ # 欢迎语
+ Label(win2, text='欢迎进入查询页面', font=('华文行楷', 20), fg='purple').pack()
+ ListB = tkinter.Listbox(win2)
+ ListB.place(relx=0.3, rely=0.3, anchor='nw', width=350)
+ li = Serch()
+ for item in li:
+ ListB.insert(0, item)
+ # 按钮
+ b2 = tkinter.Button(win2, text='退出', width=10, height=3, bg='gray', command=win2.destroy)
+ b2.place(relx=1, rely=1, anchor='se')
+ #查询学生信息
+ def show_student_frame(self):
+ win2 = tkinter.Toplevel()
+ win2.title('查询学生信息')
+ win2.geometry('700x300')
+ sw = win2.winfo_screenwidth()
+ sh = win2.winfo_screenheight()
+ win2.geometry('+%d+%d' % ((sw - 500) / 2, (sh - 300) / 2))
+ # 欢迎语
+ Label(win2, text='欢迎进入查询页面', font=('华文行楷', 20), fg='purple').pack()
+ ListB = tkinter.Listbox(win2)
+ ListB.place(relx=0.3, rely=0.3, anchor='nw', width=350)
+ li = SerchStudent()
+ for item in li:
+ ListB.insert(0, item)
+ # 按钮
+ b2 = tkinter.Button(win2, text='退出', width=10, height=3, bg='gray', command=win2.destroy)
+ b2.place(relx=1, rely=1, anchor='se')
+
+#修改操作类
+class maintainFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.id = StringVar()
+ self.name = StringVar()
+ self.sex = StringVar()
+ self.speciality = StringVar()
+ self.Title = StringVar()
+ self.classno = StringVar()
+ self.date = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='信息维护界面', font=('华文行楷', 20), fg='purple').pack()
+ Button(self, text='修改教师', command=self.update_teacher_frame).pack(anchor='center', pady=5)
+ Button(self, text='删除教师', command=self.del_teacher_frame).pack(anchor='center', pady=5)
+ Button(self, text='修改学生', command=self.update_student_frame).pack(anchor='center', pady=5)
+ Button(self, text='删除学生', command=self.del_student_frame).pack(anchor='center', pady=5)
+ #修改教师信息
+ def update_teacher_frame(self):
+ def update_show():
+ li = Serchone(id.get())
+ if len(li) == 0:
+ tkinter.messagebox.showerror("查询失败", "此教师不存在")
+ win4.destroy()
+ pth = li[0]
+ print(pth)
+ tkinter.Label(win4, text='%s' % pth[1]).place(relx=0.65, rely=0.22, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[2]).place(relx=0.65, rely=0.32, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[3]).place(relx=0.65, rely=0.42, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[4]).place(relx=0.65, rely=0.52, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[5]).place(relx=0.69, rely=0.63, anchor='center')
+
+ def UpdateDate():
+ Update(id.get(),name.get(),sex.get(),speciality.get(),Title.get(),date.get())
+ tkinter.messagebox.showerror("成功", "修改成功")
+ win4.destroy()
+ # 设置窗口位置
+ # 不能使用两次Tk()去创建窗体,因为tkinter中只能有一个主线程,
+ win4 = tkinter.Toplevel()
+ win4.title('修改教师信息')
+ win4.geometry('500x400')
+ sw = win4.winfo_screenwidth()
+ sh = win4.winfo_screenheight()
+ win4.geometry('+%d+%d' % ((sw - 500) / 2, (sh - 300) / 2))
+ # 欢迎语
+ l = tkinter.Label(win4, text='欢迎进入修改页面', font=('华文行楷', 20), fg='purple')
+ l.place(relx=0.5, rely=0.05, anchor='center')
+ id = tkinter.StringVar()
+ name = tkinter.StringVar()
+ sex = tkinter.StringVar()
+ speciality = tkinter.StringVar()
+ Title = tkinter.StringVar()
+ date = tkinter.StringVar()
+ tkinter.Label(win4, text='工号:').place(relx=0.4, rely=0.12, anchor='center')
+ tkinter.Entry(win4, textvariable=id).place(relx=0.45, rely=0.1, width=70)
+ #姓名输入框
+ tkinter.Label(win4, text='姓名:').place(relx=0.4, rely=0.22, anchor='center')
+ tkinter.Entry(win4, textvariable=name).place(relx=0.45, rely=0.2, width=70)
+ # 性别输入框
+ tkinter.Label(win4, text='性别:').place(relx=0.4, rely=0.32, anchor='center')
+ tkinter.Entry(win4, textvariable=sex).place(relx=0.45, rely=0.3, width=70)
+ # 专业输入框
+ tkinter.Label(win4, text='专业:').place(relx=0.4, rely=0.42, anchor='center')
+ tkinter.Entry(win4, textvariable=speciality).place(relx=0.45, rely=0.4, width=70)
+ # 职称输入框
+ tkinter.Label(win4, text='职称:').place(relx=0.4, rely=0.52, anchor='center')
+ tkinter.Entry(win4, textvariable=Title).place(relx=0.45, rely=0.5, width=70)
+ # 入职年月输入框
+ tkinter.Label(win4, text='入职年月:').place(relx=0.36, rely=0.62, anchor='center')
+ tkinter.Entry(win4, textvariable=date).place(relx=0.45, rely=0.6, width=70)
+
+ # 按钮
+ tkinter.Button(win4, text='查询', width=10, height=3, bg='gray', command=update_show).place(relx=0, rely=1, anchor='sw')
+ tkinter.Button(win4, text='确认修改', width=10, height=3, bg='gray', command=UpdateDate).place(relx=0.15, rely=1, anchor='sw')
+ tkinter.Button(win4, text='退出', width=10, height=3, bg='gray', command=win4.destroy).place(relx=1, rely=1, anchor='se')
+ #删除教师信息
+ def del_teacher_frame(self):
+ def show():
+ li = Serchone(id.get())
+ if len(li) == 0:
+ tkinter.messagebox.showerror("错误", "此教师不存在")
+ win3.destroy()
+ pth = li[0]
+ print(pth)
+ tkinter.Label(win3, text='%s' % pth[1]).place(relx=0.5, rely=0.2, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[2]).place(relx=0.5, rely=0.3, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[3]).place(relx=0.5, rely=0.4, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[4]).place(relx=0.5, rely=0.5, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[5]).place(relx=0.55, rely=0.6, anchor='center')
+
+ def delDate():
+ Del(id.get())
+ tkinter.messagebox.showerror("成功", "删除成功")
+ win3.destroy()
+ # 设置窗口位置
+ # 不能使用两次Tk()去创建窗体,因为tkinter中只能有一个主线程,
+ win3 = tkinter.Toplevel()
+ win3.title('删除教师信息')
+ win3.geometry('500x400')
+ sw = win3.winfo_screenwidth()
+ sh = win3.winfo_screenheight()
+ win3.geometry('+%d+%d' % ((sw - 500) / 2, (sh - 300) / 2))
+ # 欢迎语
+ l = tkinter.Label(win3, text='欢迎进入删除页面', font=('华文行楷', 20), fg='purple')
+ l.place(relx=0.5, rely=0.05, anchor='center')
+ # 工号输入框
+ # id = self.id.get()
+ id = tkinter.StringVar()
+ tkinter.Label(win3, text='工号:').place(relx=0.4, rely=0.12, anchor='center')
+ tkinter.Entry(win3, textvariable=id).place(relx=0.45, rely=0.1, width=70)
+ #姓名展示框
+ tkinter.Label(win3, text='姓名:').place(relx=0.4, rely=0.2, anchor='center')
+ # 性别展示框
+ tkinter.Label(win3, text='性别:').place(relx=0.4, rely=0.3, anchor='center')
+ # 专业展示框
+ tkinter.Label(win3, text='专业:').place(relx=0.4, rely=0.4, anchor='center')
+ # 职称展示框
+ tkinter.Label(win3, text='职称:').place(relx=0.4, rely=0.5, anchor='center')
+ # 入职年月展示框
+ tkinter.Label(win3, text='入职年月:').place(relx=0.4, rely=0.6, anchor='center')
+
+ # 按钮
+ tkinter.Button(win3, text='查询', width=10, height=3, bg='gray', command=show).place(relx=0, rely=1, anchor='sw')
+ tkinter.Button(win3, text='确认删除', width=10, height=3, bg='gray', command=delDate).place(relx=0.15, rely=1, anchor='sw')
+ tkinter.Button(win3, text='退出', width=10, height=3, bg='gray', command=win3.destroy).place(relx=1, rely=1, anchor='se')
+
+ #修改学生信息
+ def update_student_frame(self):
+ def student_show():
+ li = SerchoneStudent(id.get())
+ if len(li) == 0:
+ tkinter.messagebox.showerror("查询失败", "此学生不存在")
+ win4.destroy()
+ pth = li[0]
+ print(pth)
+ tkinter.Label(win4, text='%s' % pth[1]).place(relx=0.65, rely=0.22, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[2]).place(relx=0.65, rely=0.32, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[3]).place(relx=0.73, rely=0.42, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[4]).place(relx=0.65, rely=0.52, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[5]).place(relx=0.69, rely=0.63, anchor='center')
+
+ def UpdateDate():
+ UpdateStudent(id.get(),name.get(),sex.get(),speciality.get(),classno.get(),date.get())
+ tkinter.messagebox.showerror("成功", "修改成功")
+ win4.destroy()
+ # 设置窗口位置
+ # 不能使用两次Tk()去创建窗体,因为tkinter中只能有一个主线程,
+ win4 = tkinter.Toplevel()
+ win4.title('修改学生信息')
+ win4.geometry('500x400')
+ sw = win4.winfo_screenwidth()
+ sh = win4.winfo_screenheight()
+ win4.geometry('+%d+%d' % ((sw - 500) / 2, (sh - 300) / 2))
+ # 欢迎语
+ l = tkinter.Label(win4, text='欢迎进入修改页面', font=('华文行楷', 20), fg='purple')
+ l.place(relx=0.5, rely=0.05, anchor='center')
+ id = tkinter.StringVar()
+ name = tkinter.StringVar()
+ sex = tkinter.StringVar()
+ speciality = tkinter.StringVar()
+ classno = tkinter.StringVar()
+ date = tkinter.StringVar()
+ # 学号输入框
+ tkinter.Label(win4, text='学号:').place(relx=0.4, rely=0.12, anchor='center')
+ tkinter.Entry(win4, textvariable=id).place(relx=0.45, rely=0.1, width=70)
+ #姓名输入框
+ tkinter.Label(win4, text='姓名:').place(relx=0.4, rely=0.22, anchor='center')
+ tkinter.Entry(win4, textvariable=name).place(relx=0.45, rely=0.2, width=70)
+ # 性别输入框
+ tkinter.Label(win4, text='性别:').place(relx=0.4, rely=0.32, anchor='center')
+ tkinter.Entry(win4, textvariable=sex).place(relx=0.45, rely=0.3, width=70)
+ # 专业输入框
+ tkinter.Label(win4, text='专业:').place(relx=0.4, rely=0.42, anchor='center')
+ tkinter.Entry(win4, textvariable=speciality).place(relx=0.45, rely=0.4, width=70)
+ # 班级输入框
+ tkinter.Label(win4, text='班级:').place(relx=0.4, rely=0.52, anchor='center')
+ tkinter.Entry(win4, textvariable=classno).place(relx=0.45, rely=0.5, width=70)
+ # 入学时间输入框
+ tkinter.Label(win4, text='入学时间:').place(relx=0.36, rely=0.62, anchor='center')
+ tkinter.Entry(win4, textvariable=date).place(relx=0.45, rely=0.6, width=70)
+
+ # 按钮
+ tkinter.Button(win4, text='查询', width=10, height=3, bg='gray', command=student_show).place(relx=0, rely=1, anchor='sw')
+ tkinter.Button(win4, text='确认修改', width=10, height=3, bg='gray', command=UpdateDate).place(relx=0.15, rely=1, anchor='sw')
+ tkinter.Button(win4, text='退出', width=10, height=3, bg='gray', command=win4.destroy).place(relx=1, rely=1, anchor='se')
+ #删除学生信息
+ def del_student_frame(self):
+ def show():
+ li = SerchoneStudent(id.get())
+ if len(li) == 0:
+ tkinter.messagebox.showerror("错误", "此学生不存在")
+ win3.destroy()
+ pth = li[0]
+ print(pth)
+ tkinter.Label(win3, text='%s' % pth[1]).place(relx=0.5, rely=0.2, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[2]).place(relx=0.5, rely=0.3, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[3]).place(relx=0.5, rely=0.4, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[4]).place(relx=0.5, rely=0.5, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[5]).place(relx=0.55, rely=0.6, anchor='center')
+
+ def delDate():
+ DelStudent(id.get())
+ tkinter.messagebox.showerror("成功", "删除成功")
+ win3.destroy()
+ # 设置窗口位置
+ # 不能使用两次Tk()去创建窗体,因为tkinter中只能有一个主线程,
+ win3 = tkinter.Toplevel()
+ win3.title('删除学生信息')
+ win3.geometry('500x400')
+ sw = win3.winfo_screenwidth()
+ sh = win3.winfo_screenheight()
+ win3.geometry('+%d+%d' % ((sw - 500) / 2, (sh - 300) / 2))
+ # 欢迎语
+ l = tkinter.Label(win3, text='欢迎进入删除页面', font=('华文行楷', 20), fg='purple')
+ l.place(relx=0.5, rely=0.05, anchor='center')
+ # 学号输入框
+ id = tkinter.StringVar()
+ tkinter.Label(win3, text='学号:').place(relx=0.4, rely=0.12, anchor='center')
+ tkinter.Entry(win3, textvariable=id).place(relx=0.45, rely=0.1, width=70)
+ #姓名展示框
+ tkinter.Label(win3, text='姓名:').place(relx=0.4, rely=0.2, anchor='center')
+ # 性别展示框
+ tkinter.Label(win3, text='性别:').place(relx=0.4, rely=0.3, anchor='center')
+ # 专业展示框
+ tkinter.Label(win3, text='专业:').place(relx=0.4, rely=0.4, anchor='center')
+ # 班级展示框
+ tkinter.Label(win3, text='班级:').place(relx=0.4, rely=0.5, anchor='center')
+ # 入学日期展示框
+ tkinter.Label(win3, text='入学日期:').place(relx=0.4, rely=0.6, anchor='center')
+
+ # 按钮
+ tkinter.Button(win3, text='查询', width=10, height=3, bg='gray', command=show).place(relx=0, rely=1, anchor='sw')
+ tkinter.Button(win3, text='确认删除', width=10, height=3, bg='gray', command=delDate).place(relx=0.15, rely=1, anchor='sw')
+ tkinter.Button(win3, text='退出', width=10, height=3, bg='gray', command=win3.destroy).place(relx=1, rely=1, anchor='se')
+
+#修改密码类
+class UpdateKeywordFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='更新密码界面').pack()
\ No newline at end of file
diff --git a/HumanManages/Studentview.py b/HumanManages/Studentview.py
new file mode 100644
index 0000000..6a14492
--- /dev/null
+++ b/HumanManages/Studentview.py
@@ -0,0 +1,280 @@
+import os
+import tkinter
+
+import psutil,time,threading
+import ttkbootstrap
+from tkinter import *
+from tkinter import ttk, messagebox
+import zipfile
+
+import tkinter as tk
+import _sqlite3
+
+# 数据库
+conn = _sqlite3.connect("data.db")
+c = conn.cursor()
+# c.execute("create table score(itemName char(20),importPrice char(20),"
+# "sellPrice char(20),deductPrice char(20))")
+def Serchone(sellPrice):
+ c.execute("select itemName,deductPrice from score where score.sellPrice = '%s'" % sellPrice)
+ return c.fetchall()
+def Serchone2():
+ c.execute("select itemName,deductPrice from score order by deductPrice desc")
+ return c.fetchall()
+#根据id查询教师个人信息sql语句
+def SerchMy(name):
+ c.execute("select * from students where students.name = '%s'" % name)
+ return c.fetchall()
+#修改密码sql语句
+def UpdatePassWord(id, name):
+ c.execute('update students set id = (?) where name = (?)',
+ (id, name))
+ # 提交事务
+ conn.commit()
+
+#主窗体
+class InputFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='欢迎登录信息管理系统!!!', font=('华文行楷', 20), fg='purple').pack()
+ # #实现测网速
+ # def _():
+ # meter = ttkbootstrap.Meter(
+ # metersize=180,
+ # padding=50,
+ # amountused=0,
+ # metertype="semi",
+ # subtext="当前网速(kB/s)",
+ # subtextstyle="warning",
+ # interactive=False,
+ # bootstyle='primary',
+ # )
+ # meter.pack(side=ttkbootstrap.LEFT, padx=5)
+ # while True:
+ # meter.configure(amountused=round(getNet(), 2))
+ # def getNet():
+ # recv_before = psutil.net_io_counters().bytes_recv
+ # time.sleep(1)
+ # recv_now = psutil.net_io_counters().bytes_recv
+ # recv = (recv_now - recv_before) / 1024
+ # return recv
+ # t = threading.Thread(target=_)
+ # t.setDaemon(True)
+ # t.start()
+
+#我的信息
+class MyFrame(Frame):
+ def __init__(self, name, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.name = name
+ self.createPage()
+
+ def createPage(self):
+ Button(self, text='个人信息', command=self.My_Page).pack()
+ def My_Page(self):
+ li = SerchMy(self.name)
+ pth = li[0]
+ print(pth)
+ Label(self, text='工号: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[0]).pack(side=LEFT,ipady=10)
+ Label(self, text='姓名: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[1]).pack(side=LEFT,ipady=10)
+ Label(self, text='性别: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[2]).pack(side=LEFT,ipady=10)
+ Label(self, text='专业: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[3]).pack(side=LEFT,ipady=10)
+ Label(self, text='职称: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[4]).pack(side=LEFT,ipady=10)
+ Label(self, text='入职年月: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[5]).pack(side=LEFT,ipady=10)
+
+
+#修改密码
+class UpdatepwdFrame(Frame):
+ def __init__(self, name, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.name = name
+ self.id = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Button(self, text='修改密码', command=self.My_Page).grid()
+
+
+ def My_Page(self):
+ li = SerchMy(self.name)
+ pth = li[0]
+ print(pth)
+ self.id = tkinter.StringVar()
+ self.ids = tkinter.StringVar()
+ Label(self).grid(row=0, stick=W, pady=10)
+ Label(self, text='请输入新密码: ').grid(row=1, stick=W, pady=10)
+ Entry(self, textvariable=self.id).grid(row=1, column=1, stick=E)
+ Label(self, text='确认密码: ').grid(row=2, stick=W, pady=10)
+ Entry(self, textvariable=self.ids).grid(row=2, column=1, stick=E)
+ Button(self, text='确认修改', width=8, height=2, command=self.UpdateDate).grid(row=3, column=1, stick=E)
+ self.id.set('')
+ self.ids.set('')
+
+ def UpdateDate(self):
+ UpdatePassWord(self.id.get(),self.name)
+ tkinter.messagebox.showerror("成功", "修改成功")
+
+#查看成绩类
+class QueryFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.itemName = StringVar()
+ self.sellPrice = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='我的成绩', font=('华文行楷', 20), fg='purple').pack()
+ columns = ("itemName", "deductPrice")
+ columns_values = ("课程名称", "成绩")
+ self.tree_view = ttk.Treeview(self, show='headings', columns=columns)
+ self.tree_view.column('itemName', width=80, anchor='center')
+ self.tree_view.column('deductPrice', width=80, anchor='center')
+ self.tree_view.heading('itemName', text='课程名称')
+ self.tree_view.heading('deductPrice', text='成绩')
+ self.tree_view.pack(fill=tk.BOTH, expand=True)
+ scores = Serchone2()
+ print(scores)
+ index = 0
+ for s in scores:
+ print(s)
+ self.tree_view.insert('', index + 1, values=(
+ s[0], s[1],
+ ))
+#意见反馈类
+class CountFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='请说出你的想法', font=('华文行楷', 20), fg='purple').pack()
+ text = tk.Text(self, width=100, height=20)
+ text.pack()
+ text.insert("insert", "")
+ text.insert('end', '\n')
+ mytxtfile = "mytxtfile.txt"
+ # 读取TXT文件,显示在tkinter的Text
+ def in_f_txt():
+ if os.path.exists(mytxtfile):
+ a = open(mytxtfile, 'r', encoding='utf-8')
+ for id_names in a:
+ text.insert('insert', id_names)
+ a.close()
+
+ text.insert('end', '\n')
+ # 输入文本框
+ input_txt = tk.Entry(self, width=20)
+ input_txt.pack()
+
+ def add():
+ # 通过get()函数获得Text(input_txt)的输入内容
+ var_id = input_txt.get()
+ h = open(mytxtfile, 'a+', encoding='utf-8')
+ h.write(var_id + '\n') # 添加到文件夹中的txt
+ h.close()
+
+ b2 = tk.Button(text, text="提交意见", command=add)
+ text.window_create("insert", window=b2)
+ text.insert('end', '\n')
+
+#提交作业
+class SubmitFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.createPage()
+
+ def createPage(self):
+ Button(self, text='提交作业', font=('华文行楷', 20), command=self.show_submit_frame).pack(anchor='center', pady=5)
+ #提交作业
+ def show_submit_frame(self):
+ window = tk.Tk()
+ window.title("提交作业")
+ window.geometry("800x600") # 窗口设置
+ window.resizable(0, 0) # 固定窗口大小
+
+ var = tk.StringVar() # 输入框内容
+ self.num = 1 # 已生成的作业数量+1
+ source = str() # 单个源代码的内容
+ self.path = str() # 打包相对路径
+ # __Labels
+ head = tk.Label(window, text=" 请将第{num}题源代码复制到框中:".format(num=self.num),
+ font=('Arial', 15), width=20, height=1)
+ # 这里的长宽以字符为单位
+ head.place(x=40, y=100, anchor='nw')
+
+ name = tk.Label(window, text="请输入姓名:", font=('Arial', 15), )
+ name.place(x=3, y=5, anchor='nw')
+
+ xuehao = tk.Label(window, text="请输入学号:", font=('Arial', 15), )
+ xuehao.place(x=3, y=35, anchor='nw')
+
+ ok_txt = tk.Label(window, text="点击确定即可\n以框中内容\n生成一个.py文件:", font=('Arial', 15))
+ ok_txt.place(x=600, y=20, anchor='nw')
+
+ # __Entrys
+ name_en = tk.Entry(window)
+ name_en.place(x=145, y=8, anchor='nw')
+
+ xuehao_en = tk.Entry(window)
+ xuehao_en.place(x=145, y=38, anchor='nw')
+
+ # __Buttons
+ def make_zip(floder, backupfilename): # floder:要打包的文件夹;backupfilename:指定文件名
+ backupfilename = backupfilename + '.zip'
+ f = zipfile.ZipFile(backupfilename, 'w') # c创建一个zip对象
+
+ for floderName, subFolders, fileNames in os.walk(floder):
+ f.write(floderName)
+ for subFolder in subFolders:
+ f.write(os.path.join(floderName, subFolder))
+ for fileName in fileNames:
+ f.write(os.path.join(floderName, fileName))
+ f.close()
+
+ def ok_hit(): ##确认 键的功能
+ # global path
+ self.path = "./{xuehao}_{name}".format(xuehao=xuehao_en.get(), name=name_en.get())
+ folder = os.path.exists(self.path)
+ if not folder:
+ os.makedirs(self.path)
+ source = content.get("0.0", "end")
+
+ with open(self.path + '/' + "第{num}题.py".format(num=self.num), 'w') as f:
+ f.write(source)
+ self.num += 1
+ head.config(text="请将第{num}题源代码复制到框中:".format(num=self.num))
+ content.delete("0.0", 'end')
+ pass
+
+ def zip_them_hit(): ##打包键功能
+ make_zip(self.path, "{xuehao}_{name}".format
+ (xuehao=xuehao_en.get(), name=name_en.get()))
+ messagebox.showinfo(message="你的 {num} 个.py语言源代码\n已经打包入zip压缩包中\n在当前目录即可找到".format(num=self.num-1), title="Packing has been complished!")
+ os.system("explorer " + os.getcwd())
+ window.destroy() ##结束程序
+ pass
+ #创建Buttons
+ ok = tk.Button(window, text="确 定", command=ok_hit, width=10, height=2, font=40)
+ ok.place(x=650, y=120, anchor='nw')
+
+ zip_them = tk.Button(window, text="打包成zip", command=zip_them_hit, width=10,height=2, font=40)
+ zip_them.place(x=650, y=250, anchor='nw')
+ # __Texts
+ content = tk.Text(window, width=65, height=30)
+ content.place(x=20, y=130, anchor='nw')
+ window.mainloop()
diff --git a/HumanManages/Teacherview.py b/HumanManages/Teacherview.py
new file mode 100644
index 0000000..1fd0558
--- /dev/null
+++ b/HumanManages/Teacherview.py
@@ -0,0 +1,405 @@
+import os
+import tkinter
+from tkinter import *
+import tkinter.messagebox as mb
+from tkinter import ttk
+
+import tkinter as tk
+import _sqlite3
+
+# 数据库
+# conn = _sqlite3.connect(":memory:")
+conn = _sqlite3.connect("data.db")
+c = conn.cursor()
+#创建表score
+# c.execute("create table score(itemName char(20),importPrice char(20),"
+# "sellPrice char(20),deductPrice char(20))")
+
+#添加成绩sql语句
+def Insert(itemName, importPrice, sellPrice, deductPrice):
+ c.execute('insert into score values(?,?,?,?)', (itemName, importPrice, sellPrice, deductPrice))
+ # 提交事务
+ conn.commit()
+#根据学号删除成绩
+def Del(sellPrice):
+ c.execute("delete from score where sellPrice = '%s'" % sellPrice)
+ # 提交事务
+ conn.commit()
+#查询成绩sql语句
+def Serch():
+ c.execute('select * from score')
+ li = c.fetchall()
+ # 提交事务
+ conn.commit()
+ return li
+#显示所有的学生信息,先按照成绩从大-->小排序,当成绩相同时 按照学号从高-->矮排序:
+def Serchone2():
+ c.execute("select * from score order by deductPrice")
+ # c.execute("select * from score order by deductPrice desc,sellPrice desc")
+ # 提交事务
+ conn.commit()
+ return c.fetchall()
+#根据学号查询成绩
+def Serchone(sellPrice):
+ c.execute("select * from score where score.sellPrice = '%s'" % sellPrice)
+ # 提交事务
+ conn.commit()
+ return c.fetchall()
+# 修改成绩
+def Update(itemName, importPrice, sellPrice, deductPrice):
+ c.execute('update score set itemName = (?),importPrice = (?),deductPrice = (?) where sellPrice = (?)',
+ (itemName, importPrice, deductPrice, sellPrice))
+ # 提交事务
+ conn.commit()
+#根据id查询教师个人信息sql语句
+def SerchMy(name):
+ c.execute("select * from teachers where teachers.name = '%s'" % name)
+ return c.fetchall()
+#修改密码sql语句
+def UpdatePassWord(id, name):
+ c.execute('update teachers set id = (?) where name = (?)',
+ (id, name))
+ # 提交事务
+ conn.commit()
+
+#主窗体
+class WelcomeFrame(Frame): # 继承Frame类
+ def __init__(self, name, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.usrname = name
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='欢迎教师'+self.usrname+'登录', font=("黑体", 20)).pack()
+
+#我的信息
+class MyFrame(Frame):
+ def __init__(self, name, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.name = name
+ self.createPage()
+
+ def createPage(self):
+ Button(self, text='个人信息', command=self.My_Page).pack()
+ def My_Page(self):
+ li = SerchMy(self.name)
+ pth = li[0]
+ print(pth)
+ Label(self, text='工号: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[0]).pack(side=LEFT,ipady=10)
+ Label(self, text='姓名: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[1]).pack(side=LEFT,ipady=10)
+ Label(self, text='性别: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[2]).pack(side=LEFT,ipady=10)
+ Label(self, text='专业: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[3]).pack(side=LEFT,ipady=10)
+ Label(self, text='职称: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[4]).pack(side=LEFT,ipady=10)
+ Label(self, text='入职年月: ').pack(side=LEFT,ipady=10)
+ Label(self, text='%s' % pth[5]).pack(side=LEFT,ipady=10)
+
+
+#修改密码
+class UpdatepwdFrame(Frame):
+ def __init__(self, name, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.name = name
+ self.id = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Button(self, text='修改密码', command=self.My_Page).grid()
+
+
+ def My_Page(self):
+ li = SerchMy(self.name)
+ pth = li[0]
+ print(pth)
+ self.id = tkinter.StringVar()
+ self.ids = tkinter.StringVar()
+ Label(self).grid(row=0, stick=W, pady=10)
+ Label(self, text='请输入新密码: ').grid(row=1, stick=W, pady=10)
+ Entry(self, textvariable=self.id).grid(row=1, column=1, stick=E)
+ Label(self, text='确认密码: ').grid(row=2, stick=W, pady=10)
+ Entry(self, textvariable=self.ids).grid(row=2, column=1, stick=E)
+ Button(self, text='确认修改', width=8, height=2, command=self.UpdateDate).grid(row=3, column=1, stick=E)
+ self.id.set('')
+ self.ids.set('')
+
+ def UpdateDate(self):
+ UpdatePassWord(self.id.get(),self.name)
+ tkinter.messagebox.showerror("成功", "修改成功")
+
+#成绩录入
+class InputFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.itemName = StringVar()
+ self.importPrice = StringVar()
+ self.sellPrice = StringVar()
+ self.deductPrice = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Label(self).grid(row=0, stick=W, pady=10)
+ Label(self, text='课程名称: ').grid(row=1, stick=W, pady=10)
+ Entry(self, textvariable=self.itemName).grid(row=1, column=1, stick=E)
+ Label(self, text='班级: ').grid(row=2, stick=W, pady=10)
+ Entry(self, textvariable=self.importPrice).grid(row=2, column=1, stick=E)
+ Label(self, text='学号: ').grid(row=3, stick=W, pady=10)
+ Entry(self, textvariable=self.sellPrice).grid(row=3, column=1, stick=E)
+ Label(self, text='成绩: ').grid(row=4, stick=W, pady=10)
+ Entry(self, textvariable=self.deductPrice).grid(row=4, column=1, stick=E)
+ Button(self, text='成绩录入',command=self.AddScore).grid(row=6, column=1, stick=E, pady=10)
+ #成绩录入
+ def AddScore(self):
+ itemName = self.itemName.get()
+ importPrice = self.importPrice.get()
+ sellPrice = self.sellPrice.get()
+ deductPrice = self.deductPrice.get()
+ if sellPrice == '' or deductPrice == '':
+ mb.showerror("错误", "信息不能为空!")
+ else:
+ Insert(itemName, importPrice, sellPrice, deductPrice)
+ mb.showinfo("成功", "录入成绩成功")
+ self.itemName.set('')
+ self.importPrice.set('')
+ self.sellPrice.set('')
+ self.deductPrice.set('')
+#查询
+class QueryFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.itemName = StringVar()
+ self.sellPrice = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='查询界面', font=('华文行楷', 20), fg='purple').pack(pady=12)
+ #查询所有成绩按钮
+ Button(self, text='查询所有成绩', command=self.show_score_frame).place(relx=0.18, rely=0.2, anchor='center')
+ # 根据学号查询框
+ self.sellPrice = tkinter.StringVar()
+ tkinter.Label(self, text='学号:').place(relx=0.4, rely=0.2, anchor='center')
+ tkinter.Entry(self, textvariable=self.sellPrice).place(relx=0.46, rely=0.17, width=70)
+ #学号查询按钮
+ Button(self, text='根据学号查询', command=self.show_score_frame2).place(relx=0.85, rely=0.2, anchor='center')
+ Label(self, text='', font=('华文行楷', 20), fg='purple').pack(pady=2,anchor='w')
+ columns = ("itemName", "importPrice", "sellPrice", "deductPrice")
+ columns_values = ("课程名称", "班级", "学号", "成绩")
+ self.tree_view = ttk.Treeview(self, show='headings', columns=columns)
+ self.tree_view.column('itemName', width=80, anchor='center')
+ self.tree_view.column('importPrice', width=80, anchor='center')
+ self.tree_view.column('sellPrice', width=80, anchor='center')
+ self.tree_view.column('deductPrice', width=80, anchor='center')
+ self.tree_view.heading('itemName', text='课程名称')
+ self.tree_view.heading('importPrice', text='班级')
+ self.tree_view.heading('sellPrice', text='学号')
+ self.tree_view.heading('deductPrice', text='成绩')
+ self.tree_view.pack(fill=tk.BOTH, expand=True)
+ self.show_score_frame()
+ #查询全部学生成绩信息
+ def show_score_frame(self):
+ # 删除旧的数据
+ for _ in map(self.tree_view.delete, self.tree_view.get_children('')):
+ pass
+ students = Serch()
+ index = 0
+ for stu in students:
+ print(stu)
+ self.tree_view.insert('', index + 1, values=(
+ stu[0], stu[1], stu[2], stu[3],
+ ))
+ #根据学号查询学生信息
+ def show_score_frame2(self):
+ li = Serchone(self.sellPrice.get())
+ print(li)
+ # 删除旧的数据
+ for _ in map(self.tree_view.delete, self.tree_view.get_children('')):
+ pass
+ index = 0
+ for stu in li:
+ print(stu)
+ self.tree_view.insert('', index + 1, values=(
+ stu[0], stu[1], stu[2], stu[3],
+ #设置输入框为空
+ self.sellPrice.set('')
+ ))
+#统计
+class CountFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='统计界面', font=('华文行楷', 20), fg='purple').pack()
+ Button(self, text='根据成绩排序', command=self.show_score).pack(anchor='center', pady=5)
+ columns = ("itemName", "importPrice", "sellPrice", "deductPrice")
+ columns_values = ("课程名称", "班级", "学号", "成绩")
+ # # 创建滚动条
+ self.VScroll1 = Scrollbar(self, orient='vertical')
+ # 给treeview添加配置
+ #,yscrollcommand=self.VScroll1.setm
+ self.tree_view = ttk.Treeview(self, show='headings', columns=columns,yscrollcommand=self.VScroll1.set)
+ self.tree_view.column('itemName', width=80, anchor='center')
+ self.tree_view.column('importPrice', width=80, anchor='center')
+ self.tree_view.column('sellPrice', width=80, anchor='center')
+ self.tree_view.column('deductPrice', width=80, anchor='center')
+ self.tree_view.heading('itemName', text='课程名称')
+ self.tree_view.heading('importPrice', text='班级')
+ self.tree_view.heading('sellPrice', text='学号')
+ self.tree_view.heading('deductPrice', text='成绩')
+ self.tree_view.pack(fill=tk.BOTH, expand=True)
+ self.show_score()
+ #根据成绩排序查询全部学生成绩信息
+ def show_score(self):
+ # 删除旧的数据
+ for _ in map(self.tree_view.delete, self.tree_view.get_children('')):
+ pass
+ students = Serchone2()
+ index = 0
+ for stu in students:
+ print(stu)
+ self.tree_view.insert('', index + 1, values=(
+ stu[0], stu[1], stu[2], stu[3],
+ ))
+#编辑
+class EditFrame(Frame): # 继承Frame类
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.itemName = StringVar()
+ self.importPrice = StringVar()
+ self.sellPrice = StringVar()
+ self.deductPrice = StringVar()
+ self.createPage()
+
+ def createPage(self):
+ Label(self, text='编辑界面', font=('华文行楷', 20), fg='purple').pack()
+ Button(self, text='修改成绩', command=self.update_score_frame).pack(anchor='center', pady=5)
+ Button(self, text='删除成绩', command=self.del_score_frame).pack(anchor='center', pady=5)
+
+ # 修改成绩信息
+ def update_score_frame(self):
+ def update_show():
+ li = Serchone(sellPrice.get())
+ if len(li) == 0:
+ tkinter.messagebox.showerror("查询失败", "学号不存在")
+ win4.destroy()
+ pth = li[0]
+ print(pth)
+ tkinter.Label(win4, text='%s' % pth[1]).place(relx=0.67, rely=0.22, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[0]).place(relx=0.67, rely=0.32, anchor='center')
+ tkinter.Label(win4, text='%s' % pth[3]).place(relx=0.67, rely=0.42, anchor='center')
+
+ def UpdateDate():
+ Update(itemName.get(), importPrice.get(), sellPrice.get(), deductPrice.get())
+ tkinter.messagebox.showerror("成功", "修改成功")
+ win4.destroy()
+ # 设置窗口位置
+ # 不能使用两次Tk()去创建窗体,因为tkinter中只能有一个主线程,
+ win4 = tkinter.Toplevel()
+ win4.title('修改学生成绩')
+ win4.geometry('500x400')
+ sw = win4.winfo_screenwidth()
+ sh = win4.winfo_screenheight()
+ win4.geometry('+%d+%d' % ((sw - 500) / 2, (sh - 300) / 2))
+ # 欢迎语
+ l = tkinter.Label(win4, text='欢迎进入修改页面', font=('华文行楷', 20), fg='purple')
+ l.place(relx=0.5, rely=0.05, anchor='center')
+ itemName = tkinter.StringVar()
+ importPrice = tkinter.StringVar()
+ sellPrice = tkinter.StringVar()
+ deductPrice = tkinter.StringVar()
+ #学号输入框
+ tkinter.Label(win4, text='学号:').place(relx=0.4, rely=0.12, anchor='center')
+ tkinter.Entry(win4, textvariable=sellPrice).place(relx=0.47, rely=0.1, width=70)
+ # 班级输入框
+ tkinter.Label(win4, text='班级:').place(relx=0.4, rely=0.22, anchor='center')
+ tkinter.Entry(win4, textvariable=importPrice).place(relx=0.47, rely=0.2, width=70)
+ # 课程名称输入框
+ tkinter.Label(win4, text='课程名称:').place(relx=0.4, rely=0.32, anchor='center')
+ tkinter.Entry(win4, textvariable=itemName).place(relx=0.47, rely=0.3, width=70)
+ # 成绩输入框
+ tkinter.Label(win4, text='成绩:').place(relx=0.4, rely=0.42, anchor='center')
+ tkinter.Entry(win4, textvariable=deductPrice).place(relx=0.47, rely=0.4, width=70)
+ # 按钮
+ tkinter.Button(win4, text='查询', width=10, height=3, bg='gray', command=update_show).place(relx=0, rely=1,anchor='sw')
+ tkinter.Button(win4, text='确认修改', width=10, height=3, bg='gray', command=UpdateDate).place(relx=0.15,rely=1,anchor='sw')
+ tkinter.Button(win4, text='退出', width=10, height=3, bg='gray', command=win4.destroy).place(relx=1, rely=1,anchor='se')
+
+ # 删除成绩信息
+ def del_score_frame(self):
+ def show():
+ li = Serchone(sellPrice.get())
+ if len(li) == 0:
+ tkinter.messagebox.showerror("错误", "学号不存在")
+ win3.destroy()
+ pth = li[0]
+ print(pth)
+ tkinter.Label(win3, text='%s' % pth[0]).place(relx=0.52, rely=0.2, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[1]).place(relx=0.52, rely=0.3, anchor='center')
+ tkinter.Label(win3, text='%s' % pth[3]).place(relx=0.52, rely=0.4, anchor='center')
+
+ def delDate():
+ Del(sellPrice.get())
+ tkinter.messagebox.showerror("成功", "删除成功")
+ win3.destroy()
+ # 设置窗口位置
+ # 不能使用两次Tk()去创建窗体,因为tkinter中只能有一个主线程,
+
+ win3 = tkinter.Toplevel()
+ win3.title('删除教师信息')
+ win3.geometry('500x400')
+ sw = win3.winfo_screenwidth()
+ sh = win3.winfo_screenheight()
+ win3.geometry('+%d+%d' % ((sw - 500) / 2, (sh - 300) / 2))
+ # 欢迎语
+ l = tkinter.Label(win3, text='欢迎进入删除页面', font=('华文行楷', 20), fg='purple')
+ l.place(relx=0.5, rely=0.05, anchor='center')
+ # 学号输入框
+ sellPrice = tkinter.StringVar()
+ tkinter.Label(win3, text='学号:').place(relx=0.41, rely=0.12, anchor='center')
+ tkinter.Entry(win3, textvariable=sellPrice).place(relx=0.47, rely=0.1, width=70)
+ # 课程名称展示框
+ tkinter.Label(win3, text='课程名称:').place(relx=0.38, rely=0.2, anchor='center')
+ # 班级展示框
+ tkinter.Label(win3, text='班级:').place(relx=0.41, rely=0.3, anchor='center')
+ # 成绩展示框
+ tkinter.Label(win3, text='成绩:').place(relx=0.41, rely=0.4, anchor='center')
+
+ # 按钮
+ tkinter.Button(win3, text='查询', width=10, height=3, bg='gray', command=show).place(relx=0, rely=1,anchor='sw')
+ tkinter.Button(win3, text='确认删除', width=10, height=3, bg='gray', command=delDate).place(relx=0.15, rely=1,anchor='sw')
+ tkinter.Button(win3, text='退出', width=10, height=3, bg='gray', command=win3.destroy).place(relx=1, rely=1,anchor='se')
+#意见反馈
+class FeedbackFrame(Frame):
+ def __init__(self, master=None):
+ Frame.__init__(self, master)
+ self.root = master # 定义内部变量root
+ self.createPage()
+ def createPage(self):
+ Label(self, text='学生意见收集箱', font=('华文行楷', 20), fg='purple').pack()
+ text = tk.Text(self, width=100, height=20)
+ text.pack()
+ text.insert("insert", "")
+ text.insert('end', '\n')
+ mytxtfile = "mytxtfile.txt"
+ # 读取TXT文件,显示在tkinter的Text
+ def in_f_txt():
+ if os.path.exists(mytxtfile):
+ a = open(mytxtfile, 'r', encoding='utf-8')
+ for id_names in a:
+ text.insert('insert', id_names)
+ a.close()
+
+ b3 = tk.Button(text, text="查看", command=in_f_txt)
+ text.window_create("insert", window=b3)
+ text.insert('end', '\n')
+
diff --git a/HumanManages/__pycache__/MainPages.cpython-310.pyc b/HumanManages/__pycache__/MainPages.cpython-310.pyc
new file mode 100644
index 0000000..f402ed3
Binary files /dev/null and b/HumanManages/__pycache__/MainPages.cpython-310.pyc differ
diff --git a/HumanManages/__pycache__/MainPages.cpython-312.pyc b/HumanManages/__pycache__/MainPages.cpython-312.pyc
new file mode 100644
index 0000000..1e404cf
Binary files /dev/null and b/HumanManages/__pycache__/MainPages.cpython-312.pyc differ
diff --git a/HumanManages/__pycache__/MainPages.cpython-39.pyc b/HumanManages/__pycache__/MainPages.cpython-39.pyc
new file mode 100644
index 0000000..f3aa778
Binary files /dev/null and b/HumanManages/__pycache__/MainPages.cpython-39.pyc differ
diff --git a/HumanManages/__pycache__/Managerview.cpython-310.pyc b/HumanManages/__pycache__/Managerview.cpython-310.pyc
new file mode 100644
index 0000000..0e1c28b
Binary files /dev/null and b/HumanManages/__pycache__/Managerview.cpython-310.pyc differ
diff --git a/HumanManages/__pycache__/Managerview.cpython-312.pyc b/HumanManages/__pycache__/Managerview.cpython-312.pyc
new file mode 100644
index 0000000..0da98e3
Binary files /dev/null and b/HumanManages/__pycache__/Managerview.cpython-312.pyc differ
diff --git a/HumanManages/__pycache__/Managerview.cpython-39.pyc b/HumanManages/__pycache__/Managerview.cpython-39.pyc
new file mode 100644
index 0000000..d37b1a9
Binary files /dev/null and b/HumanManages/__pycache__/Managerview.cpython-39.pyc differ
diff --git a/HumanManages/__pycache__/Studentview.cpython-310.pyc b/HumanManages/__pycache__/Studentview.cpython-310.pyc
new file mode 100644
index 0000000..0ae70cf
Binary files /dev/null and b/HumanManages/__pycache__/Studentview.cpython-310.pyc differ
diff --git a/HumanManages/__pycache__/Studentview.cpython-312.pyc b/HumanManages/__pycache__/Studentview.cpython-312.pyc
new file mode 100644
index 0000000..fb801ce
Binary files /dev/null and b/HumanManages/__pycache__/Studentview.cpython-312.pyc differ
diff --git a/HumanManages/__pycache__/Studentview.cpython-39.pyc b/HumanManages/__pycache__/Studentview.cpython-39.pyc
new file mode 100644
index 0000000..6ba0459
Binary files /dev/null and b/HumanManages/__pycache__/Studentview.cpython-39.pyc differ
diff --git a/HumanManages/__pycache__/Teacherview.cpython-310.pyc b/HumanManages/__pycache__/Teacherview.cpython-310.pyc
new file mode 100644
index 0000000..ec3b1b0
Binary files /dev/null and b/HumanManages/__pycache__/Teacherview.cpython-310.pyc differ
diff --git a/HumanManages/__pycache__/Teacherview.cpython-312.pyc b/HumanManages/__pycache__/Teacherview.cpython-312.pyc
new file mode 100644
index 0000000..267f73d
Binary files /dev/null and b/HumanManages/__pycache__/Teacherview.cpython-312.pyc differ
diff --git a/HumanManages/__pycache__/Teacherview.cpython-39.pyc b/HumanManages/__pycache__/Teacherview.cpython-39.pyc
new file mode 100644
index 0000000..1902cf9
Binary files /dev/null and b/HumanManages/__pycache__/Teacherview.cpython-39.pyc differ
diff --git a/HumanManages/data.db b/HumanManages/data.db
new file mode 100644
index 0000000..99d64b3
Binary files /dev/null and b/HumanManages/data.db differ
diff --git a/HumanManages/demo1.py b/HumanManages/demo1.py
new file mode 100644
index 0000000..5a424fd
--- /dev/null
+++ b/HumanManages/demo1.py
@@ -0,0 +1,118 @@
+import tkinter as tk
+from tkinter import messagebox
+import os
+import zipfile
+
+window = tk.Tk()
+window.title("Homework Packer 1.0 Beta")
+window.geometry("800x600") # 窗口设置
+window.resizable(0, 0) # 固定窗口大小
+
+var = tk.StringVar() # 输入框内容
+num = 1 # 已生成的作业数量+1
+source = str() # 单个c源代码的内容
+path = str() # 打包相对路径
+#__Labels
+head = tk.Label(window, text="请将第{num}题源代码复制到框中:".format(num=num),
+ font=('Arial', 15), width=20, height=1)
+# 这里的长宽以字符为单位
+head.place(x=20, y=100, anchor='nw')
+
+name = tk.Label(window, text="请输入姓名:",font=('Arial', 15), )
+name.place(x=2, y=5, anchor='nw')
+
+xuehao = tk.Label(window, text="请输入学号:",font=('Arial', 15), )
+xuehao.place(x=2, y=35, anchor='nw')
+
+ok_txt = tk.Label(window, text="点击确定即可\n以框中内容\n生成一个.py文件:", font=('Arial', 15))
+ok_txt.place(x=600, y=20, anchor='nw')
+
+#__Entrys
+name_en = tk.Entry(window)
+name_en.place(x=122, y=8, anchor='nw')
+
+xuehao_en = tk.Entry(window)
+xuehao_en.place(x=122, y=38, anchor='nw')
+
+
+#__Buttons
+def make_zip(floder, backupfilename): # floder:要打包的文件夹;backupfilename:指定文件名
+ backupfilename = backupfilename + '.zip'
+ f = zipfile.ZipFile(backupfilename, 'w') # c创建一个zip对象
+
+ for floderName, subFolders, fileNames in os.walk(floder):
+ f.write(floderName)
+ for subFolder in subFolders:
+ f.write(os.path.join(floderName, subFolder))
+ for fileName in fileNames:
+ f.write(os.path.join(floderName, fileName))
+ f.close()
+
+
+def ok_hit(): ##确认 键的功能
+ global path
+ path = "./{xuehao}_{name}".format(xuehao=xuehao_en.get(),name=name_en.get())
+ folder = os.path.exists(path)
+ if not folder:
+ os.makedirs(path)
+ source = content.get("0.0", "end")
+ global num
+ with open(path + '/' + "第{num}题.py".format(num=num), 'w') as f:
+ f.write(source)
+ num += 1
+ head.config(text="请将第{num}题源代码复制到框中:".format(num=num))
+ content.delete("0.0", 'end')
+ pass
+
+
+def zip_them_hit(): ##打包键功能
+ make_zip(path, "{xuehao}_{name}".format
+ (xuehao=xuehao_en.get(), name=name_en.get()))
+ messagebox.showinfo(message="你的 {num} 个c语言源代码\n已经打包入zip压缩包中\n\
+ 在当前目录即可找到".format(
+ num=num - 1), title="Packing has been complished!")
+ os.system("explorer " + os.getcwd())
+ window.destroy() ##结束程序
+ pass
+
+
+def about_file(): ##文件介绍
+ win = tk.Tk()
+ win.title("关于本软件")
+ win.geometry("400x500") # 窗口设置
+ win.resizable(0, 0) # 固定窗口大小
+ tk.Label(win, text="========================================\n\
+使用方法很简单:\n\
+1.输入姓名和学号\n\
+2.每完成一题编程作业就将源码复制到框里。\n\
+3.点击<确定>。\n\
+4.重复2,3步直到作业做完\n\
+5.点击<打包成zip> 即可在程序所在的目录\n\
+下找到压缩包。\n\
+\n\
+(包名字都是按本班 C语言作业命\n\
+名要求设置的,所以这个软件基本上就给自\n\
+己人使用。)\n\
+========================================\n\
+========================================", anchor='ne').pack()
+
+ pass
+
+
+# # # # # # # # # # # ## 创建Buttons
+ok = tk.Button(window, text="确 定", command=ok_hit, width=10, height=2, font=40)
+ok.place(x=650, y=120, anchor='nw')
+
+zip_them = tk.Button(window, text="打包成zip", command=zip_them_hit, width=10,
+ height=2, font=40)
+zip_them.place(x=650, y=250, anchor='nw')
+# about HMPacker1.0Beta
+about = tk.Button(window, text="关于本软件", command=about_file, font=5)
+about.place(x=600, y=550, anchor='nw')
+
+#__Texts
+content = tk.Text(window, width=80, height=30)
+content.place(x=20, y=130, anchor='nw')
+
+about_file() # 运行的时候打开以下about_file 因为里面有操作方法
+window.mainloop()
\ No newline at end of file
diff --git a/HumanManages/main.py b/HumanManages/main.py
new file mode 100644
index 0000000..c244cdc
--- /dev/null
+++ b/HumanManages/main.py
@@ -0,0 +1,32 @@
+import tkinter
+from tkinter import *
+from tkinter.ttk import Style
+
+import ttkbootstrap as ttk
+from ttkbootstrap.constants import *
+
+import MainPages
+import tkinter.messagebox as mb
+
+def callback():
+ if mb.askokcancel("退出系统", "你确定要退出系统吗?"):
+ root.destroy()
+#想要切换主题,修改theme值即可,有以下这么多的主题,自己尝试吧:['vista', 'classic', 'cyborg', 'journal',
+# 'darkly', 'flatly', 'clam', 'alt', 'solar', 'minty', 'litera', 'united', 'xpnative',
+# 'pulse', 'cosmo', 'lumen', 'yeti', 'superhero', 'winnative', 'sandstone', 'default']
+
+
+
+root = ttk.Window(title="窗口名字", #设置窗口的标题
+ themename="flatly", #设置主题
+ size=(2066,600), #窗口的大小
+ position=(100,100), #窗口所在的位置
+ minsize=(0,0), #窗口的最小宽高
+ maxsize=(1920,1080), #窗口的最大宽高
+ resizable=None, #设置窗口是否可以更改大小
+ alpha=1.0, )
+root.title('教务管理系统')
+root.protocol("WM_DELETE_WINDOW", callback)
+MainPages.LoginPage(root)
+
+root.mainloop()
\ No newline at end of file
diff --git a/HumanManages/mytxtfile.txt b/HumanManages/mytxtfile.txt
new file mode 100644
index 0000000..82f88ad
--- /dev/null
+++ b/HumanManages/mytxtfile.txt
@@ -0,0 +1,4 @@
+1.课好多
+2.作业好多
+3.不想上学
+4.好多作业呀
diff --git a/J123 b/J123
new file mode 160000
index 0000000..4d94f46
--- /dev/null
+++ b/J123
@@ -0,0 +1 @@
+Subproject commit 4d94f463fc3cd8bd89bdbee7eb7181e3e5a56fa9
diff --git a/first b/first
new file mode 100644
index 0000000..a569435
--- /dev/null
+++ b/first
@@ -0,0 +1,12 @@
+import tkinter as tk
+
+# 创建一个简单的Tkinter窗口
+root = tk.Tk()
+root.title("Tkinter检查")
+
+# 添加一个标签
+label = tk.Label(root, text="Tkinter已安装!")
+label.pack()
+
+# 启动主事件循环
+root.mainloop()