基于Python的人脸识别课堂系统(毕设)——附录下

本文章承接《基于Python的人脸识别课堂考勤系统(毕设)》,填坑上篇文章遗留的代码部分。因为项目分的模块比较多,再加上本人能力有限,所以代码过于臃肿还存在许多优化的地方。同样本篇文章也仅适用于小白,零基础人群。

PS:每个文件之中代码都已经区分开来,可以对照左侧目录部分实现快速预览!

        由于代码过于多我这里分成上,下两个部分来发布吧!

一、ui文件——意见反馈界面

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'qt_8feedback.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1168, 721)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(-10, 0, 1181, 671))
        self.label.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.label.setStyleSheet("background-image: url(:/新前缀/pi_5main_21反馈背景.png);")
        self.label.setText("")
        self.label.setObjectName("label")
        self.homepushButton = QtWidgets.QPushButton(self.centralwidget)
        self.homepushButton.setGeometry(QtCore.QRect(77, 63, 111, 111))
        self.homepushButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_12home.png);")
        self.homepushButton.setText("")
        self.homepushButton.setObjectName("homepushButton")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1168, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))

import rc_8feedback_rc

二、ui文件——随机抽检界面

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'qt_9random.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1176, 708)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(-10, -6, 1191, 671))
        self.label.setStyleSheet("background-image: url(:/新前缀/pi_5main_26随机背景.png);")
        self.label.setText("")
        self.label.setObjectName("label")
        self.homeButton = QtWidgets.QPushButton(self.centralwidget)
        self.homeButton.setGeometry(QtCore.QRect(80, 50, 111, 111))
        self.homeButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_12home.png);")
        self.homeButton.setText("")
        self.homeButton.setObjectName("homeButton")
        self.randomButton = QtWidgets.QPushButton(self.centralwidget)
        self.randomButton.setGeometry(QtCore.QRect(80, 298, 121, 101))
        self.randomButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_27抽检.png);")
        self.randomButton.setText("")
        self.randomButton.setObjectName("randomButton")
        self.changeButton = QtWidgets.QPushButton(self.centralwidget)
        self.changeButton.setGeometry(QtCore.QRect(327, 523, 71, 61))
        self.changeButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_24改为缺勤.png);")
        self.changeButton.setText("")
        self.changeButton.setObjectName("changeButton")
        self.backButton = QtWidgets.QPushButton(self.centralwidget)
        self.backButton.setGeometry(QtCore.QRect(566, 527, 61, 51))
        self.backButton.setStyleSheet("\n"
"border-image: url(:/新前缀/pi_5main_25撤销操作.png);")
        self.backButton.setText("")
        self.backButton.setObjectName("backButton")
        self.random_idlabel = QtWidgets.QLabel(self.centralwidget)
        self.random_idlabel.setGeometry(QtCore.QRect(391, 40, 331, 41))
        self.random_idlabel.setStyleSheet("font: 18pt \"微软雅黑\";")
        self.random_idlabel.setAlignment(QtCore.Qt.AlignCenter)
        self.random_idlabel.setObjectName("random_idlabel")
        self.id_lineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.id_lineEdit.setGeometry(QtCore.QRect(340, 190, 161, 31))
        self.id_lineEdit.setStyleSheet("font: 25 14pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.id_lineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.id_lineEdit.setObjectName("id_lineEdit")
        self.cls_lineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.cls_lineEdit.setGeometry(QtCore.QRect(535, 190, 141, 31))
        self.cls_lineEdit.setStyleSheet("font: 25 14pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.cls_lineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.cls_lineEdit.setObjectName("cls_lineEdit")
        self.name_lineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.name_lineEdit.setGeometry(QtCore.QRect(340, 276, 161, 31))
        self.name_lineEdit.setStyleSheet("font: 25 14pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.name_lineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.name_lineEdit.setObjectName("name_lineEdit")
        self.sexlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.sexlineEdit.setGeometry(QtCore.QRect(570, 275, 71, 31))
        self.sexlineEdit.setStyleSheet("font: 25 14pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.sexlineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.sexlineEdit.setObjectName("sexlineEdit")
        self.att_lineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.att_lineEdit.setGeometry(QtCore.QRect(360, 391, 121, 31))
        self.att_lineEdit.setStyleSheet("font: 25 14pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.att_lineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.att_lineEdit.setObjectName("att_lineEdit")
        self.rer_lineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.rer_lineEdit.setGeometry(QtCore.QRect(550, 392, 121, 31))
        self.rer_lineEdit.setStyleSheet("font: 25 14pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.rer_lineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.rer_lineEdit.setObjectName("rer_lineEdit")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1176, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.random_idlabel.setText(_translate("MainWindow", "0000000000"))
        self.id_lineEdit.setText(_translate("MainWindow", "--"))
        self.cls_lineEdit.setText(_translate("MainWindow", "--"))
        self.name_lineEdit.setText(_translate("MainWindow", "--"))
        self.sexlineEdit.setText(_translate("MainWindow", "--"))
        self.att_lineEdit.setText(_translate("MainWindow", "--"))
        self.rer_lineEdit.setText(_translate("MainWindow", "0%"))


import rc_9random_rc

三、ui文件——使用指南界面

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'qt_10_useguide.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1175, 718)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(-6, -3, 1181, 671))
        self.label.setStyleSheet("background-image: url(:/新前缀/pi_5main_28指南背景.png);")
        self.label.setText("")
        self.label.setObjectName("label")
        self.homepushButton = QtWidgets.QPushButton(self.centralwidget)
        self.homepushButton.setGeometry(QtCore.QRect(63, 54, 111, 111))
        self.homepushButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_12home.png);")
        self.homepushButton.setText("")
        self.homepushButton.setObjectName("homepushButton")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1175, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))


import rc_10useguide_rc

四、ui文件——数据仓储界面

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'qt_13datawarehousing.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1176, 714)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(-5, -7, 1181, 671))
        self.label.setStyleSheet("background-image: url(:/新前缀/pi_5main_33数据背景.png);")
        self.label.setText("")
        self.label.setObjectName("label")
        self.homepushButton = QtWidgets.QPushButton(self.centralwidget)
        self.homepushButton.setGeometry(QtCore.QRect(79, 53, 111, 111))
        self.homepushButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_12home.png);")
        self.homepushButton.setText("")
        self.homepushButton.setObjectName("homepushButton")
        self.deleteButton = QtWidgets.QPushButton(self.centralwidget)
        self.deleteButton.setGeometry(QtCore.QRect(730, 60, 101, 111))
        self.deleteButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_31删除数据.png);")
        self.deleteButton.setText("")
        self.deleteButton.setObjectName("deleteButton")
        self.changeButton = QtWidgets.QPushButton(self.centralwidget)
        self.changeButton.setGeometry(QtCore.QRect(99, 508, 81, 61))
        self.changeButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_32信息变更.png);")
        self.changeButton.setText("")
        self.changeButton.setObjectName("changeButton")
        self.idlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.idlineEdit.setGeometry(QtCore.QRect(420, 126, 201, 31))
        self.idlineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 16pt \"微软雅黑\";")
        self.idlineEdit.setText("")
        self.idlineEdit.setObjectName("idlineEdit")
        self.pwdlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.pwdlineEdit.setGeometry(QtCore.QRect(420, 170, 201, 31))
        self.pwdlineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 16pt \"微软雅黑\";")
        self.pwdlineEdit.setText("")
        self.pwdlineEdit.setObjectName("pwdlineEdit")
        self.collegelineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.collegelineEdit.setGeometry(QtCore.QRect(370, 375, 241, 31))
        self.collegelineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.collegelineEdit.setText("")
        self.collegelineEdit.setObjectName("collegelineEdit")
        self.majorlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.majorlineEdit.setGeometry(QtCore.QRect(369, 414, 241, 31))
        self.majorlineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.majorlineEdit.setText("")
        self.majorlineEdit.setObjectName("majorlineEdit")
        self.clslineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.clslineEdit.setGeometry(QtCore.QRect(820, 293, 241, 31))
        self.clslineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.clslineEdit.setText("")
        self.clslineEdit.setObjectName("clslineEdit")
        self.sexlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.sexlineEdit.setGeometry(QtCore.QRect(820, 340, 241, 31))
        self.sexlineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.sexlineEdit.setText("—不可变更项—")
        self.sexlineEdit.setObjectName("sexlineEdit")
        self.namelineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.namelineEdit.setGeometry(QtCore.QRect(820, 400, 241, 31))
        self.namelineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.namelineEdit.setText("")
        self.namelineEdit.setObjectName("namelineEdit")
        self.emaillineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.emaillineEdit.setGeometry(QtCore.QRect(820, 512, 241, 31))
        self.emaillineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.emaillineEdit.setText("无")
        self.emaillineEdit.setObjectName("emaillineEdit")
        self.phonelineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.phonelineEdit.setGeometry(QtCore.QRect(820, 560, 241, 31))
        self.phonelineEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.phonelineEdit.setText("")
        self.phonelineEdit.setObjectName("phonelineEdit")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1176, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))


import rc_13datawarehousing_rc

五、ui文件——账户仓储界面

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'qt_14accountwarehousing.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1173, 718)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(-7, -5, 1181, 671))
        self.label.setStyleSheet("background-image: url(:/新前缀/pi_5main_38账户背景.png);")
        self.label.setText("")
        self.label.setObjectName("label")
        self.homepushButton = QtWidgets.QPushButton(self.centralwidget)
        self.homepushButton.setGeometry(QtCore.QRect(78, 53, 111, 111))
        self.homepushButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_12home.png);")
        self.homepushButton.setText("")
        self.homepushButton.setObjectName("homepushButton")
        self.protectButton = QtWidgets.QPushButton(self.centralwidget)
        self.protectButton.setGeometry(QtCore.QRect(706, 65, 111, 101))
        self.protectButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_34账户保护.png);")
        self.protectButton.setText("")
        self.protectButton.setObjectName("protectButton")
        self.cancellationButton = QtWidgets.QPushButton(self.centralwidget)
        self.cancellationButton.setGeometry(QtCore.QRect(699, 291, 110, 110))
        self.cancellationButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_35注销账户.png);")
        self.cancellationButton.setText("")
        self.cancellationButton.setObjectName("cancellationButton")
        self.cuserButton = QtWidgets.QPushButton(self.centralwidget)
        self.cuserButton.setGeometry(QtCore.QRect(859, 293, 110, 110))
        self.cuserButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_36变更账户.png);")
        self.cuserButton.setText("")
        self.cuserButton.setObjectName("cuserButton")
        self.cpwdButton = QtWidgets.QPushButton(self.centralwidget)
        self.cpwdButton.setGeometry(QtCore.QRect(993, 288, 110, 110))
        self.cpwdButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_37变更密钥.png);")
        self.cpwdButton.setText("")
        self.cpwdButton.setObjectName("cpwdButton")
        self.changeButton = QtWidgets.QPushButton(self.centralwidget)
        self.changeButton.setGeometry(QtCore.QRect(100, 509, 81, 61))
        self.changeButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_32信息变更.png);")
        self.changeButton.setText("")
        self.changeButton.setObjectName("changeButton")
        self.userlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.userlineEdit.setGeometry(QtCore.QRect(409, 126, 191, 31))
        self.userlineEdit.setStyleSheet("font: 16pt \"微软雅黑\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"")
        self.userlineEdit.setText("")
        self.userlineEdit.setObjectName("userlineEdit")
        self.pwdlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.pwdlineEdit.setGeometry(QtCore.QRect(408, 170, 191, 31))
        self.pwdlineEdit.setStyleSheet("font: 16pt \"微软雅黑\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"")
        self.pwdlineEdit.setText("")
        self.pwdlineEdit.setObjectName("pwdlineEdit")
        self.cuserEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.cuserEdit.setGeometry(QtCore.QRect(424, 356, 191, 31))
        self.cuserEdit.setStyleSheet("font: 16pt \"微软雅黑\";\n"
"color: rgb(170, 0, 0);\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.cuserEdit.setText("")
        self.cuserEdit.setObjectName("cuserEdit")
        self.cpwdEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.cpwdEdit.setGeometry(QtCore.QRect(424, 400, 191, 31))
        self.cpwdEdit.setStyleSheet("font: 16pt \"微软雅黑\";\n"
"color: rgb(170, 0, 0);\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.cpwdEdit.setText("")
        self.cpwdEdit.setObjectName("cpwdEdit")
        self.cidEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.cidEdit.setGeometry(QtCore.QRect(425, 517, 241, 31))
        self.cidEdit.setStyleSheet("font: 16pt \"微软雅黑\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.cidEdit.setText("")
        self.cidEdit.setObjectName("cidEdit")
        self.cschoolEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.cschoolEdit.setGeometry(QtCore.QRect(376, 564, 291, 31))
        self.cschoolEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.cschoolEdit.setText("-不可变更-")
        self.cschoolEdit.setObjectName("cschoolEdit")
        self.cnameEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.cnameEdit.setGeometry(QtCore.QRect(768, 518, 161, 31))
        self.cnameEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.cnameEdit.setText("")
        self.cnameEdit.setObjectName("cnameEdit")
        self.ccollegeEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.ccollegeEdit.setGeometry(QtCore.QRect(768, 564, 291, 31))
        self.ccollegeEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.ccollegeEdit.setText("")
        self.ccollegeEdit.setObjectName("ccollegeEdit")
        self.csexEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.csexEdit.setGeometry(QtCore.QRect(1004, 518, 121, 31))
        self.csexEdit.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"font: 25 14pt \"微软雅黑 Light\";")
        self.csexEdit.setText("-不可变更-")
        self.csexEdit.setObjectName("csexEdit")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1173, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))


import rc_14accountwarehousing_rc

六、ui文件——数据分析界面

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'qt_15dataanalysis.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1175, 711)
        MainWindow.setStyleSheet("")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(-7, -7, 1181, 671))
        self.label.setStyleSheet("background-image: url(:/新前缀/pi_5main_39_2数据背景.png);")
        self.label.setText("")
        self.label.setObjectName("label")
        self.idlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.idlineEdit.setGeometry(QtCore.QRect(146, 492, 171, 31))
        self.idlineEdit.setStyleSheet("font: 25 16pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.idlineEdit.setText("")
        self.idlineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.idlineEdit.setObjectName("idlineEdit")
        self.textEdit = QtWidgets.QTextEdit(self.centralwidget)
        self.textEdit.setGeometry(QtCore.QRect(840, 110, 301, 521))
        self.textEdit.setStyleSheet("font: 25 14pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.textEdit.setObjectName("textEdit")
        self.dataButton = QtWidgets.QPushButton(self.centralwidget)
        self.dataButton.setGeometry(QtCore.QRect(60, 260, 121, 121))
        self.dataButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_3数据分析.png);")
        self.dataButton.setText("")
        self.dataButton.setObjectName("dataButton")
        self.absentlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.absentlineEdit.setGeometry(QtCore.QRect(611, 590, 81, 31))
        self.absentlineEdit.setStyleSheet("font: 25 16pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.absentlineEdit.setText("")
        self.absentlineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.absentlineEdit.setObjectName("absentlineEdit")
        self.homeButton = QtWidgets.QPushButton(self.centralwidget)
        self.homeButton.setGeometry(QtCore.QRect(60, 41, 121, 121))
        self.homeButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_12home.png);")
        self.homeButton.setText("")
        self.homeButton.setObjectName("homeButton")
        self.labellineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.labellineEdit.setGeometry(QtCore.QRect(276, 590, 150, 41))
        self.labellineEdit.setStyleSheet("font: 18pt \"微软雅黑\";\n"
"color: rgb(255, 60, 42);\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.labellineEdit.setText("")
        self.labellineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.labellineEdit.setObjectName("labellineEdit")
        self.label_5 = QtWidgets.QLabel(self.centralwidget)
        self.label_5.setGeometry(QtCore.QRect(590, 330, 101, 41))
        self.label_5.setStyleSheet("font: 18pt \"微软雅黑\";")
        self.label_5.setObjectName("label_5")
        self.sumlineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.sumlineEdit.setGeometry(QtCore.QRect(611, 550, 81, 31))
        self.sumlineEdit.setStyleSheet("font: 25 16pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.sumlineEdit.setText("")
        self.sumlineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.sumlineEdit.setObjectName("sumlineEdit")
        self.staraButton = QtWidgets.QPushButton(self.centralwidget)
        self.staraButton.setGeometry(QtCore.QRect(40, 490, 111, 41))
        self.staraButton.setStyleSheet("border-image: url(:/新前缀/pi_5main_20文本框专用.png);\n"
"color: rgb(0, 0, 255);\n"
"font: 15pt \"微软雅黑\";")
        self.staraButton.setObjectName("staraButton")
        self.label_4 = QtWidgets.QLabel(self.centralwidget)
        self.label_4.setGeometry(QtCore.QRect(340, 333, 101, 41))
        self.label_4.setStyleSheet("font: 18pt \"微软雅黑\";")
        self.label_4.setObjectName("label_4")
        self.attendancelineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.attendancelineEdit.setGeometry(QtCore.QRect(170, 550, 71, 31))
        self.attendancelineEdit.setStyleSheet("font: 25 16pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.attendancelineEdit.setText("")
        self.attendancelineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.attendancelineEdit.setObjectName("attendancelineEdit")
        self.percentagelineEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.percentagelineEdit.setGeometry(QtCore.QRect(170, 590, 91, 31))
        self.percentagelineEdit.setStyleSheet("font: 25 16pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.percentagelineEdit.setText("")
        self.percentagelineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.percentagelineEdit.setObjectName("percentagelineEdit")
        self.lineEdit_3 = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_3.setGeometry(QtCore.QRect(361, 548, 71, 31))
        self.lineEdit_3.setStyleSheet("font: 25 16pt \"微软雅黑 Light\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.lineEdit_3.setText("")
        self.lineEdit_3.setAlignment(QtCore.Qt.AlignCenter)
        self.lineEdit_3.setObjectName("lineEdit_3")
        self.comelabel = QtWidgets.QLabel(self.centralwidget)
        self.comelabel.setGeometry(QtCore.QRect(290, 136, 201, 171))
        self.comelabel.setText("")
        self.comelabel.setObjectName("comelabel")
        self.labellineEdit_2 = QtWidgets.QLineEdit(self.centralwidget)
        self.labellineEdit_2.setGeometry(QtCore.QRect(500, 490, 271, 41))
        self.labellineEdit_2.setStyleSheet("font: 18pt \"微软雅黑\";\n"
"border-image: url(:/新前缀/pi_5main_20文本框专用.png);")
        self.labellineEdit_2.setText("")
        self.labellineEdit_2.setAlignment(QtCore.Qt.AlignCenter)
        self.labellineEdit_2.setObjectName("labellineEdit_2")
        self.nolabel = QtWidgets.QLabel(self.centralwidget)
        self.nolabel.setGeometry(QtCore.QRect(540, 136, 201, 171))
        self.nolabel.setText("")
        self.nolabel.setObjectName("nolabel")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1175, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.textEdit.setHtml(_translate("MainWindow", "\n"
"\n"
"


")) self.label_5.setText(_translate("MainWindow", "缺席率")) self.staraButton.setText(_translate("MainWindow", "开始分析")) self.label_4.setText(_translate("MainWindow", "出勤率")) import rc_15dataanalysis_rc

本文文章为中,上述及后续的ui文件脚本见上。

诚挚的欢迎大家一起来讨论,提出问题批评指正。

你可能感兴趣的:(前端,开发语言,python)