当前位置:   article > 正文

免费分享一套PyQt6学生信息管理系统 Python管理系统 Python源码,挺漂亮的_python qt6 制作信息管理系统

python qt6 制作信息管理系统

大家好,我是java1234_小锋老师,看到一个不错的PyQt6学生信息管理系统 Python管理系统 Python源码,分享下哈。

项目视频演示

【免费】PyQt5 学生信息管理系统 Python管理系统 Python源码 Python毕业设计_哔哩哔哩_bilibili【免费】PyQt5 学生信息管理系统 Python管理系统 Python源码 Python毕业设计项目来自互联网,免费开源分享,严禁商业。更多Python源码:http://www.java1234.com/a/bysj/python/, 视频播放量 67、弹幕量 0、点赞数 2、投硬币枚数 0、收藏人数 3、转发人数 1, 视频作者 java1234官方, 作者简介 公众号:java1234 微信:java9266,相关视频:【免费】javaweb物业管理系统毕业设计,【免费】javaweb固定资产管理系统毕业设计,2024版 PyQt6 Python桌面开发 视频教程(无废话版) 玩命更新中~,【免费】javaweb高校教务管理系统毕业设计,【免费】javaweb实验室管理系统毕业设计,【免费】javaweb机房管理系统毕业设计,2024 1小时学会 Python操作Mysql数据库之pymysql模块技术(无废话版),【免费】springboot+vue学生选课管理系统毕业设计演示,【免费】javaweb企业人事管理系统毕业设计,【免费】javaweb学生信息管理系统毕业设计icon-default.png?t=N7T8https://www.bilibili.com/video/BV1Ep4y1R7WD/

项目介绍

期末作业要求用Qt做一个学生管理系统,笔者这段时间在自学Python,本项目主要实现了PyQt5的增删改查。因为学习PyQt5的时间短,写代码时遇到了很多困难,笔者在CSDN与Github上我查阅了大量的资料,最终做了一个半成品出来。但笔者认为,以这个小项目作为一个入门练手项目十分合适,现将其分享,希望能够帮助到新手入门的人。 本项目主要用到了PyQt5、pymysql、xlwt模块、Mysql数据库、QtDesigner和pyuic。PyQt5用于构建GUI界面,pymysql用于与MySQL数据库连接,xlwt用于操作excel。 MySQL数据库笔者采用了navicat数据库管理工具。MySQL具体使用方法此文不作详细解释。

系统展示

部分代码

  1. # -*- coding: utf-8 -*-
  2. # Form implementation generated from reading ui file 'login.ui'
  3. #
  4. # Created by: PyQt5 UI code generator 5.13.2
  5. #
  6. # WARNING! All changes made in this file will be lost!
  7. from PyQt5 import QtCore, QtGui, QtWidgets
  8. from PyQt5.QtCore import qInstallMessageHandler, QtCriticalMsg
  9. from PyQt5.QtWidgets import QMessageBox
  10. import sys # 导入sys模块
  11. import main
  12. from service import service
  13. class Ui_MainWindow(object):
  14. def setupUi(self, MainWindow):
  15. MainWindow.setObjectName("MainWindow")
  16. MainWindow.setWindowFlags(QtCore.Qt.MSWindowsFixedSizeDialogHint) # 只显示最小化和关闭按钮
  17. MainWindow.resize(360, 196)
  18. self.centralwidget = QtWidgets.QWidget(MainWindow)
  19. self.centralwidget.setObjectName("centralwidget")
  20. self.label = QtWidgets.QLabel(self.centralwidget)
  21. self.label.setGeometry(QtCore.QRect(0, 0, 360, 80))
  22. self.label.setStyleSheet("border-image: url('./images/login.jpg');")
  23. self.label.setText("")
  24. self.label.setObjectName("label")
  25. self.label_2 = QtWidgets.QLabel(self.centralwidget)
  26. self.label_2.setGeometry(QtCore.QRect(120, 100, 61, 21))
  27. font = QtGui.QFont()
  28. font.setPointSize(11)
  29. self.label_2.setFont(font)
  30. self.label_2.setObjectName("label_2")
  31. self.editName = QtWidgets.QLineEdit(self.centralwidget)
  32. self.editName.setGeometry(QtCore.QRect(193, 100, 141, 20))
  33. self.editName.setObjectName("editName")
  34. self.editPwd = QtWidgets.QLineEdit(self.centralwidget)
  35. self.editPwd.setGeometry(QtCore.QRect(192, 130, 141, 20))
  36. self.editPwd.setEchoMode(QtWidgets.QLineEdit.Password)
  37. self.editPwd.setObjectName("editPwd")
  38. self.label_3 = QtWidgets.QLabel(self.centralwidget)
  39. self.label_3.setGeometry(QtCore.QRect(119, 130, 61, 21))
  40. font = QtGui.QFont()
  41. font.setPointSize(11)
  42. self.label_3.setFont(font)
  43. self.label_3.setObjectName("label_3")
  44. self.btnLogin = QtWidgets.QPushButton(self.centralwidget)
  45. self.btnLogin.setGeometry(QtCore.QRect(200, 160, 61, 23))
  46. self.btnLogin.setObjectName("btnLogin")
  47. self.btnExit = QtWidgets.QPushButton(self.centralwidget)
  48. self.btnExit.setGeometry(QtCore.QRect(270, 160, 61, 23))
  49. self.btnExit.setObjectName("btnExit")
  50. MainWindow.setCentralWidget(self.centralwidget)
  51. self.retranslateUi(MainWindow)
  52. self.btnExit.clicked.connect(MainWindow.close) # 关闭登录窗体
  53. QtCore.QMetaObject.connectSlotsByName(MainWindow)
  54. # 输入密码后按回车键执行登录操作
  55. self.editPwd.editingFinished.connect(self.openMain)
  56. # 单击“登录”按钮执行登录操作
  57. self.btnLogin.clicked.connect(self.openMain)
  58. # 打开主窗体
  59. def openMain(self):
  60. service.userName=self.editName.text() # 全局变量,记录用户名
  61. self.userPwd=self.editPwd.text() # 记录用户密码
  62. if service.userName != "" and self.userPwd != "": # 判断用户名和密码不为空
  63. # 根据用户名和密码查询数据
  64. result=service.query("select * from tb_user where userName = %s and userPwd = %s",service.userName,self.userPwd)
  65. if len(result)>0: # 如果查询结果大于0,说明存在该用户,可以登录
  66. self.m = main.Ui_MainWindow() # 创建主窗体对象
  67. self.m.show() # 显示主窗体
  68. MainWindow.hide() # 隐藏当前的登录窗体
  69. else:
  70. self.editName.setText("") # 清空用户名文本
  71. self.editPwd.setText("") # 清空密码文本框
  72. QMessageBox.warning(None, '警告', '请输入正确的用户名和密码!', QMessageBox.Ok)
  73. else:
  74. QMessageBox.warning(None, '警告', '请输入用户名和密码!', QMessageBox.Ok)
  75. def retranslateUi(self, MainWindow):
  76. _translate = QtCore.QCoreApplication.translate
  77. MainWindow.setWindowTitle(_translate("MainWindow", "系统登录"))
  78. self.label_2.setText(_translate("MainWindow", "用户名:"))
  79. self.label_3.setText(_translate("MainWindow", "密 码:"))
  80. self.btnLogin.setText(_translate("MainWindow", "登录"))
  81. self.btnExit.setText(_translate("MainWindow", "退出"))
  82. # 主方法
  83. if __name__ == '__main__':
  84. app = QtWidgets.QApplication(sys.argv)
  85. MainWindow = QtWidgets.QMainWindow() # 创建窗体对象
  86. ui = Ui_MainWindow() # 创建PyQt5设计的窗体对象
  87. ui.setupUi(MainWindow) # 调用PyQt5窗体的方法对窗体对象进行初始化设置
  88. MainWindow.show() # 显示窗体
  89. sys.exit(app.exec_()) # 程序关闭时退出进程
  1. # -*- coding: utf-8 -*-
  2. # Form implementation generated from reading ui file 'main.ui'
  3. #
  4. # Created by: PyQt5 UI code generator 5.13.2
  5. #
  6. # WARNING! All changes made in this file will be lost!
  7. from PyQt5 import QtCore, QtGui, QtWidgets
  8. from PyQt5.QtWidgets import *
  9. from service import service
  10. from baseinfo import student
  11. from query import studentinfo
  12. from settings import classes,grade
  13. from system import user
  14. class Ui_MainWindow(QMainWindow):
  15. # 构造方法
  16. def __init__(self):
  17. super(Ui_MainWindow, self).__init__()
  18. self.setWindowFlags(QtCore.Qt.MSWindowsFixedSizeDialogHint) # 只显示最小化和关闭按钮
  19. self.setupUi(self) # 初始化窗体设置
  20. def setupUi(self, MainWindow):
  21. MainWindow.setObjectName("MainWindow")
  22. MainWindow.resize(792, 583)
  23. icon = QtGui.QIcon()
  24. icon.addPixmap(QtGui.QPixmap("./images/appstu.ICO"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
  25. MainWindow.setWindowIcon(icon)
  26. MainWindow.setIconSize(QtCore.QSize(32, 32))
  27. self.centralwidget = QtWidgets.QWidget(MainWindow)
  28. self.centralwidget.setStyleSheet("border-image: url('./images/main.jpg');")
  29. self.centralwidget.setObjectName("centralwidget")
  30. MainWindow.setCentralWidget(self.centralwidget)
  31. self.menubar = QtWidgets.QMenuBar(MainWindow)
  32. self.menubar.setGeometry(QtCore.QRect(0, 0, 792, 23))
  33. self.menubar.setObjectName("menubar")
  34. self.menu = QtWidgets.QMenu(self.menubar)
  35. self.menu.setObjectName("menu")
  36. self.menu_2 = QtWidgets.QMenu(self.menubar)
  37. self.menu_2.setObjectName("menu_2")
  38. self.menu_3 = QtWidgets.QMenu(self.menubar)
  39. self.menu_3.setObjectName("menu_3")
  40. self.menu_4 = QtWidgets.QMenu(self.menubar)
  41. self.menu_4.setObjectName("menu_4")
  42. MainWindow.setMenuBar(self.menubar)
  43. self.statusbar = QtWidgets.QStatusBar(MainWindow)
  44. self.statusbar.setObjectName("statusbar")
  45. MainWindow.setStatusBar(self.statusbar)
  46. self.actiongrade = QtWidgets.QAction(MainWindow)
  47. self.actiongrade.setObjectName("actiongrade")
  48. self.actionclass = QtWidgets.QAction(MainWindow)
  49. self.actionclass.setObjectName("actionclass")
  50. self.actionstudent = QtWidgets.QAction(MainWindow)
  51. self.actionstudent.setObjectName("actionstudent")
  52. self.actionstudentinfo = QtWidgets.QAction(MainWindow)
  53. self.actionstudentinfo.setObjectName("actionstudentinfo")
  54. self.actionuserinfo = QtWidgets.QAction(MainWindow)
  55. self.actionuserinfo.setObjectName("actionuserinfo")
  56. self.actionexit = QtWidgets.QAction(MainWindow)
  57. self.actionexit.setObjectName("actionexit")
  58. self.menu.addAction(self.actiongrade)
  59. self.menu.addAction(self.actionclass)
  60. self.menu_2.addAction(self.actionstudent)
  61. self.menu_3.addAction(self.actionstudentinfo)
  62. self.menu_4.addAction(self.actionuserinfo)
  63. self.menu_4.addAction(self.actionexit)
  64. self.menubar.addAction(self.menu.menuAction())
  65. self.menubar.addAction(self.menu_2.menuAction())
  66. self.menubar.addAction(self.menu_3.menuAction())
  67. self.menubar.addAction(self.menu_4.menuAction())
  68. self.retranslateUi(MainWindow)
  69. self.actionexit.triggered.connect(MainWindow.close)
  70. QtCore.QMetaObject.connectSlotsByName(MainWindow)
  71. datetime = QtCore.QDateTime.currentDateTime() # 获取当前日期时间
  72. time = datetime.toString("yyyy-MM-dd HH:mm:ss") # 对日期时间进行格式化
  73. # 状态栏中显示登录用户、登录时间,以及版权信息
  74. self.statusbar.showMessage("当前登录用户:" + service.userName + " | 登录时间:" + time + " | www.python222.com 收藏整理",0)
  75. # 为基础设置菜单中的QAction绑定triggered信号
  76. self.menu.triggered[QtWidgets.QAction].connect(self.openSet)
  77. # 为基本信息管理菜单中的QAction绑定triggered信号
  78. self.menu_2.triggered[QtWidgets.QAction].connect(self.openBase)
  79. # 为系统查询菜单中的QAction绑定triggered信号
  80. self.menu_3.triggered[QtWidgets.QAction].connect(self.openQuery)
  81. # 为系统管理菜单中的QAction绑定triggered信号
  82. self.menu_4.triggered[QtWidgets.QAction].connect(self.openSys)
  83. # 基础设置菜单对应槽函数
  84. def openSet(self,m):
  85. if m.text()=="年级设置":
  86. self.m = grade.Ui_MainWindow() # 创建年级设置窗体对象
  87. self.m.show() # 显示窗体
  88. elif m.text()=="班级设置":
  89. self.m = classes.Ui_MainWindow() # 创建班级设置窗体对象
  90. self.m.show() # 显示窗体
  91. # 基本信息管理菜单对应槽函数
  92. def openBase(self,m):
  93. if m.text()=="学生管理":
  94. self.m = student.Ui_MainWindow() # 创建学生管理窗体对象
  95. self.m.show() # 显示窗体
  96. # 系统查询菜单对应槽函数
  97. def openQuery(self,m):
  98. if m.text()=="学生信息查询":
  99. self.m = studentinfo.Ui_MainWindow() # 创建学生信息查询窗体对象
  100. self.m.show() # 显示窗体
  101. # 系统管理菜单对应槽函数
  102. def openSys(self,m):
  103. if m.text()=="用户维护":
  104. self.m = user.Ui_MainWindow() # 创建用户维护窗体对象
  105. self.m.show() # 显示窗体
  106. def retranslateUi(self, MainWindow):
  107. _translate = QtCore.QCoreApplication.translate
  108. MainWindow.setWindowTitle(_translate("MainWindow", "学生成绩管理系统"))
  109. self.menu.setTitle(_translate("MainWindow", "基础设置"))
  110. self.menu_2.setTitle(_translate("MainWindow", "基本信息管理"))
  111. self.menu_3.setTitle(_translate("MainWindow", "系统查询"))
  112. self.menu_4.setTitle(_translate("MainWindow", "系统管理"))
  113. self.actiongrade.setText(_translate("MainWindow", "年级设置"))
  114. self.actionclass.setText(_translate("MainWindow", "班级设置"))
  115. self.actionstudent.setText(_translate("MainWindow", "学生管理"))
  116. self.actionstudentinfo.setText(_translate("MainWindow", "学生信息查询"))
  117. self.actionuserinfo.setText(_translate("MainWindow", "用户维护"))
  118. self.actionexit.setText(_translate("MainWindow", "退出"))

源码下载

CSDN 1积分下载:https://download.csdn.net/download/caofeng891102/88680194

或者免费领取加小锋老师wx:java9266

热门推荐

免费分享一套Springboot+Vue前后端分离的停车场管理系统,挺漂亮的-CSDN博客

免费分享一套Springboot+Vue前后端分离的个人博客系统,挺漂亮的-CSDN博客

免费分享一套Springboot+Vue前后端分离的学生网上请假系统,挺漂亮的-CSDN博客

免费分享一套基于springboot的进销存(仓库)管理系统,挺漂亮的-CSDN博客

免费分享一套 SpringBoot + Vue + ElementUI 的人力资源管理系统,挺漂亮的_element+springboot员工工资管理-CSDN博客

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/49975
推荐阅读
相关标签
  

闽ICP备14008679号