基于python的大学学生信息管理系统

本文介绍了一个基于Python的大学学生信息管理系统,该系统使用了tkinter库进行GUI设计。在运行过程中遇到了MySQL连接错误:pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([WinError 10061] 由于目标计算机积极拒绝,无法连接。)"). 为解决此问题,可以参考提供的优快云论坛链接进行排查。" 139579286,11651472,C++实现Capon空时自适应算法详解与实践,"['算法', 'c++', '目标跟踪', '信号处理']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

from tkinter import *
from tkinter import ttk


from tkinter import messagebox  # 导入提示窗口包
from connect_mysql import Mysql_conn
from dLink import DouLink, Node



def run_nn():
    # 设置窗口大小
    def center_window(root, width, height):
        screenwidth = root.winfo_screenwidth()
        screenheight = root.winfo_screenheight()
        size = '%dx%d+%d+%d' % (width, height, (screenwidth - width) / 2, (screenheight - height) / 2)
        root.geometry(size)


    class GUI:
        """给每个组件都命名是为了以后迭代方便"""

        def __init__(self, root):
            # 创建双向链表
            self.dl = DouLink()
            root.title('学生信息管理系统 ')
            # 设置窗口大小
            center_window(root, 800, 600)
            root.maxsize(1200, 800)
            root.minsize(300, 240)
            root.iconbitmap('1.png')

            # 添加学员
            upload_label_1 = ttk.Label(root, text='姓名').grid(row=0, column=1)
            upload_label_2 = ttk.Label(root, text='年龄').grid(row=1, column=1)
            upload_label_3 = ttk.Label(root, text='电话号码').grid(row=2, column=1)
            upload_label_4 = ttk.Label(root, text='入学日期').grid(row=3, column=1)
            upload_label_5 = ttk.Label(root, text='邮箱').grid(row=4, column=1)

            upload_entry_1 = ttk.Entry(root)
            upload_entry_2 = ttk.Entry(root)
            upload_entry_3 = ttk.Entry(root)
            upload_entry_4 = ttk.Entry(root)
            upload_entry_5 = ttk.Entry(root)

            upload_entry_1.grid(row=0, column=2)
            upload_entry_2.grid(row=1, column=2)
            upload_entry_3.grid(row=2, column=2)
            upload_entry_4.grid(row=3, column=2)
            upload_entry_5.grid(row=4, column=2)

            upload_button_1 = ttk.Button(root, text="提交信息", command=lambda: upload_event()).grid(row=6, column=2)

            # 修改信息
            update_label_1 = ttk.Label(root, text='需更新学号').grid(row=0, column=3)
            update_label_2 = ttk.Label(root, text='姓名').grid(row=1, column=3)
            update_label_3 = ttk.Label(root, text='年龄').grid(row=2, column=3)
            update_label_4 = ttk.Label(root, text='电话号码').grid(row=3, column=3)
            update_label_5 = ttk.Label(root, text='入学日期').grid(row=4, column=3)
            update_label_6 = ttk.Label(root, text='邮箱').grid(row=5, column=3)

            update_entry_1 = ttk.Entry(root)
            update_entry_2 = ttk.Entry(root)
            update_entry_3 = ttk.Entry(root)
            update_entry_4 = ttk.Entry(root)
            update_entry_5 = ttk.Entry(root)
            update_entry_6 = ttk.Entry(root)

            update_entry_1.grid(row=0, column=4)
            update_entry_2.grid(row=1, column=4)
            update_entry_3.grid(row=2, column=4)
            update_entry_4.grid(row=3, column=4)
            update_entry_5.grid(row=4, column=4)
            update_entry_6.grid(row=5, column=4)

            update_button = ttk.Button(root, text='更新信息',command=lambda: update_event()).grid(row=6, column=4)

            # 查找学员
            search_listbox = Listbox(root, height=3)
            for item in ['按学号查找', '按姓名查找', '按年龄查找']:
                search_listbox.insert(END, item)
            search_listbox.grid(row=0, column=6, rowspan=3)

            search_label = ttk.Label(root, text='查找参数').grid(row=3, column=5)

            search_entry = ttk.Entry(root)
            search_entry.grid(row=3, column=6)

            search_button = ttk.Button(root, text='查找', command=lambda: search_event()).grid(row=5, column=6)
            delete_button = ttk.Button(root, text='删除该学员', command=lambda: delete_event()).grid(row=6, column=6)

            # 排序
            sort_button_1 = ttk.Button(root, text='按学号排序', command=lambda: sort_event(1)).grid(row=1, column=7)
            sort_button_1 = ttk.Button(root, text='按姓名排序', command=lambda: sort_event(2)).grid(row=2, column=7)
            sort_button_1 = ttk.Button(root, text='按年龄排序', command=lambda: sort_event(3)).grid(row=3,
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值