资源简介

基于Python的学生管理系统

资源截图

代码片段和文件信息

from tkinter import  *
import database as add
class AddStudent:
    def __init__(self):
        root=Tk()
        root.title(‘新增学生‘)
        Label(root text=‘学号:‘).grid(row=0)
        Label(root text=‘姓名:‘).grid(row=1)
        Label(root text=‘年龄:‘).grid(row=2)
        Label(root text=‘性别:‘).grid(row=3)
        Label(root text=‘班级:‘).grid(row=4)
        Label(root text=‘电话:‘).grid(row=5)
        Label(root text=‘地址:‘).grid(row=6)

        id=Entry(roottextvariable=StringVar())
        name=Entry(roottextvariable=StringVar())
        age=Entry(roottextvariable=StringVar())
        gender = Entry(root textvariable=StringVar())
        cla = Entry(root textvariable=StringVar())
        phone = Entry(root textvariable=StringVar())
        address = Entry(root textvariable=StringVar())

        id.grid(row=0 column=1 padx=10 pady=10)
        name.grid(row=1 column=1 padx=10 pady=5)
        age.grid(row=2 column=1 padx=10 pady=5)
        gender.grid(row=3 column=1 padx=10 pady=5)
        cla.grid(row=4 column=1 padx=10 pady=5)
        phone.grid(row=5 column=1 padx=10 pady=5)
        address.grid(row=6 column=1 padx=10 pady=5)

        def adds():
            sid=int(id.get())
            sname=name.get()
            sage=int(age.get())
            sgender = gender.get()
            scla = cla.get()
            sphone = int(phone.get())
            saddress = address.get()

            add.Add(sid sname sage sgender scla sphone saddress)

            id.delete(0 END)
            name.delete(0 END)
            age.delete(0 END)
            gender.delete(0 END)
            cla.delete(0 END)
            phone.delete(0 END)
            address.delete(0 END)
        Button(roottext=‘添加‘width=10command=adds).grid(row=7column=0sticky=Wpadx=10pady=5)
        Button(roottext=‘取消‘width=10command=root.quit).grid(row=7column=1sticky=Epadx=10pady=5)
        mainloop()
if __name__==‘__main__‘:
    AddStudent()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        4139  2020-08-20 11:02  student\venv\Lib\site-packages\pip-10.0.1-py3.7.egg\pip\_vendor\html5lib\_utils.py
     文件          61  2020-08-20 11:04  student\venv\pip-selfcheck.json
     目录           0  2021-06-08 19:48  student\
     文件        2030  2020-08-21 01:51  student\AddStudent.py
     文件         685  2020-08-20 22:55  student\Delete.py
     文件        2864  2020-08-22 05:10  student\Find.py
     文件        3732  2021-05-31 21:31  student\Main.py
     文件        1784  2020-08-22 04:19  student\Sexfind.py
     文件        2057  2020-08-20 22:46  student\Update.py
     目录           0  2021-06-08 19:48  student\__pycache__\
     文件        1829  2020-08-21 01:56  student\__pycache__\AddStudent.cpython-37.pyc
     文件        1813  2020-08-30 18:09  student\__pycache__\AddStudent.cpython-38.pyc
     文件        1844  2021-05-31 21:12  student\__pycache__\AddStudent.cpython-39.pyc
     文件        1078  2020-08-20 22:55  student\__pycache__\Delete.cpython-37.pyc
     文件        1092  2020-08-30 18:10  student\__pycache__\Delete.cpython-38.pyc
     文件        1123  2021-05-31 21:25  student\__pycache__\Delete.cpython-39.pyc
     文件        2708  2020-08-22 05:10  student\__pycache__\Find.cpython-37.pyc
     文件        2460  2020-08-30 18:10  student\__pycache__\Find.cpython-38.pyc
     文件        2473  2021-05-31 21:25  student\__pycache__\Find.cpython-39.pyc
     文件        4116  2020-08-22 14:50  student\__pycache__\Main.cpython-37.pyc
     文件        1859  2020-08-22 04:23  student\__pycache__\Sexfind.cpython-37.pyc
     文件        1864  2020-08-30 18:10  student\__pycache__\Sexfind.cpython-38.pyc
     文件        1887  2021-05-31 21:25  student\__pycache__\Sexfind.cpython-39.pyc
     文件        1814  2020-08-20 22:46  student\__pycache__\Update.cpython-37.pyc
     文件        1798  2020-08-30 18:10  student\__pycache__\Update.cpython-38.pyc
     文件        1829  2021-05-31 21:25  student\__pycache__\Update.cpython-39.pyc
     文件        3679  2020-08-29 20:16  student\__pycache__\database.cpython-37.pyc
     文件        3485  2020-12-10 12:44  student\__pycache__\database.cpython-38.pyc
     文件        3554  2021-05-31 21:25  student\__pycache__\database.cpython-39.pyc
     文件        1807  2020-08-21 20:29  student\__pycache__\idFind.cpython-37.pyc
     文件        1964  2020-08-23 00:29  student\__pycache__\sorsub.cpython-37.pyc
............此处省略756个文件信息

评论

共有 条评论