コード例 #1
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 600)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum,
                                           QtWidgets.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        MainWindow.setAutoFillBackground(False)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout_6.setObjectName("gridLayout_6")
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_6.addItem(spacerItem, 1, 0, 1, 10)
        self.initDataButton = QtWidgets.QPushButton(self.centralwidget)
        self.initDataButton.setObjectName("initDataButton")
        self.gridLayout_6.addWidget(self.initDataButton, 2, 3, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(18, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_6.addItem(spacerItem1, 2, 5, 1, 1)
        self.plotButton = QtWidgets.QPushButton(self.centralwidget)
        self.plotButton.setObjectName("plotButton")
        self.gridLayout_6.addWidget(self.plotButton, 2, 8, 1, 1)
        self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
        self.tabWidget.setObjectName("tabWidget")
        self.tab = QtWidgets.QWidget()
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth())
        self.tab.setSizePolicy(sizePolicy)
        self.tab.setObjectName("tab")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.tab)
        self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.formLayout = QtWidgets.QFormLayout()
        self.formLayout.setContentsMargins(10, -1, -1, 0)
        self.formLayout.setVerticalSpacing(0)
        self.formLayout.setObjectName("formLayout")
        spacerItem2 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.formLayout.setItem(0, QtWidgets.QFormLayout.SpanningRole,
                                spacerItem2)
        self.pushButton_openfile = QtWidgets.QPushButton(self.tab)
        self.pushButton_openfile.setObjectName("pushButton_openfile")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                  self.pushButton_openfile)
        spacerItem3 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.formLayout.setItem(1, QtWidgets.QFormLayout.FieldRole,
                                spacerItem3)
        spacerItem4 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.formLayout.setItem(2, QtWidgets.QFormLayout.SpanningRole,
                                spacerItem4)
        self.gridLayout_3.addLayout(self.formLayout, 0, 0, 1, 1)
        self.formLayout_2 = QtWidgets.QFormLayout()
        self.formLayout_2.setObjectName("formLayout_2")
        self.label_4 = QtWidgets.QLabel(self.tab)
        self.label_4.setObjectName("label_4")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                    self.label_4)
        self.dataDescTable = QtWidgets.QTableWidget(self.tab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.dataDescTable.sizePolicy().hasHeightForWidth())
        self.dataDescTable.setSizePolicy(sizePolicy)
        self.dataDescTable.setSizeAdjustPolicy(
            QtWidgets.QAbstractScrollArea.AdjustToContents)
        self.dataDescTable.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.dataDescTable.setShowGrid(True)
        self.dataDescTable.setWordWrap(False)
        self.dataDescTable.setRowCount(0)
        self.dataDescTable.setObjectName("dataDescTable")
        self.dataDescTable.setColumnCount(0)
        self.dataDescTable.horizontalHeader().setDefaultSectionSize(50)
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.SpanningRole,
                                    self.dataDescTable)
        self.gridLayout_3.addLayout(self.formLayout_2, 1, 0, 1, 1)
        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = QtWidgets.QWidget()
        self.tab_2.setObjectName("tab_2")
        self.gridLayout = QtWidgets.QGridLayout(self.tab_2)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        self.groupBox_2 = QtWidgets.QGroupBox(self.tab_2)
        self.groupBox_2.setObjectName("groupBox_2")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_2)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.radioButton_ignorenan = QtWidgets.QRadioButton(self.groupBox_2)
        self.radioButton_ignorenan.setChecked(True)
        self.radioButton_ignorenan.setObjectName("radioButton_ignorenan")
        self.horizontalLayout_3.addWidget(self.radioButton_ignorenan)
        self.radioButton_delnan = QtWidgets.QRadioButton(self.groupBox_2)
        self.radioButton_delnan.setChecked(False)
        self.radioButton_delnan.setObjectName("radioButton_delnan")
        self.horizontalLayout_3.addWidget(self.radioButton_delnan)
        self.radioButton_fillnan = QtWidgets.QRadioButton(self.groupBox_2)
        self.radioButton_fillnan.setObjectName("radioButton_fillnan")
        self.horizontalLayout_3.addWidget(self.radioButton_fillnan)
        self.gridLayout_5.addLayout(self.horizontalLayout_3, 0, 0, 1, 6)
        self.checkNaNButton = QtWidgets.QPushButton(self.groupBox_2)
        self.checkNaNButton.setObjectName("checkNaNButton")
        self.gridLayout_5.addWidget(self.checkNaNButton, 1, 0, 1, 1)
        self.repealButton_nan = QtWidgets.QPushButton(self.groupBox_2)
        self.repealButton_nan.setObjectName("repealButton_nan")
        self.gridLayout_5.addWidget(self.repealButton_nan, 1, 4, 1, 1)
        spacerItem5 = QtWidgets.QSpacerItem(146, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_5.addItem(spacerItem5, 1, 5, 1, 1)
        self.okButton_nan = QtWidgets.QPushButton(self.groupBox_2)
        self.okButton_nan.setObjectName("okButton_nan")
        self.gridLayout_5.addWidget(self.okButton_nan, 1, 2, 1, 1)
        spacerItem6 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_5.addItem(spacerItem6, 1, 1, 1, 1)
        spacerItem7 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_5.addItem(spacerItem7, 1, 3, 1, 1)
        self.gridLayout.addWidget(self.groupBox_2, 0, 0, 1, 1)
        self.groupBox_3 = QtWidgets.QGroupBox(self.tab_2)
        self.groupBox_3.setObjectName("groupBox_3")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName("gridLayout_4")
        spacerItem8 = QtWidgets.QSpacerItem(232, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_4.addItem(spacerItem8, 3, 5, 1, 1)
        self.initButton_nondim = QtWidgets.QPushButton(self.groupBox_3)
        self.initButton_nondim.setObjectName("initButton_nondim")
        self.gridLayout_4.addWidget(self.initButton_nondim, 3, 4, 1, 1)
        self.okButton_nondim = QtWidgets.QPushButton(self.groupBox_3)
        self.okButton_nondim.setObjectName("okButton_nondim")
        self.gridLayout_4.addWidget(self.okButton_nondim, 3, 0, 1, 1)
        self.repealButton_nondim = QtWidgets.QPushButton(self.groupBox_3)
        self.repealButton_nondim.setObjectName("repealButton_nondim")
        self.gridLayout_4.addWidget(self.repealButton_nondim, 3, 2, 1, 1)
        spacerItem9 = QtWidgets.QSpacerItem(74, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_4.addItem(spacerItem9, 3, 1, 1, 1)
        spacerItem10 = QtWidgets.QSpacerItem(73, 20,
                                             QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_4.addItem(spacerItem10, 3, 3, 1, 1)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.radioButton_ignorenondim = QtWidgets.QRadioButton(self.groupBox_3)
        self.radioButton_ignorenondim.setObjectName("radioButton_ignorenondim")
        self.horizontalLayout_4.addWidget(self.radioButton_ignorenondim)
        self.radioButton_zstandard = QtWidgets.QRadioButton(self.groupBox_3)
        self.radioButton_zstandard.setChecked(True)
        self.radioButton_zstandard.setObjectName("radioButton_zstandard")
        self.horizontalLayout_4.addWidget(self.radioButton_zstandard)
        self.radioButton_01standard = QtWidgets.QRadioButton(self.groupBox_3)
        self.radioButton_01standard.setObjectName("radioButton_01standard")
        self.horizontalLayout_4.addWidget(self.radioButton_01standard)
        self.radioButton_normalizer = QtWidgets.QRadioButton(self.groupBox_3)
        self.radioButton_normalizer.setObjectName("radioButton_normalizer")
        self.horizontalLayout_4.addWidget(self.radioButton_normalizer)
        self.gridLayout_4.addLayout(self.horizontalLayout_4, 0, 0, 1, 6)
        self.gridLayout.addWidget(self.groupBox_3, 1, 0, 1, 1)
        self.tabWidget.addTab(self.tab_2, "")
        self.tab_3 = QtWidgets.QWidget()
        self.tab_3.setObjectName("tab_3")
        self.gridLayout_8 = QtWidgets.QGridLayout(self.tab_3)
        self.gridLayout_8.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_8.setObjectName("gridLayout_8")
        self.groupBox_2D = QtWidgets.QGroupBox(self.tab_3)
        self.groupBox_2D.setEnabled(True)
        self.groupBox_2D.setCheckable(False)
        self.groupBox_2D.setObjectName("groupBox_2D")
        self.radioButton_2Dline = QtWidgets.QRadioButton(self.groupBox_2D)
        self.radioButton_2Dline.setGeometry(QtCore.QRect(10, 22, 59, 16))
        self.radioButton_2Dline.setChecked(True)
        self.radioButton_2Dline.setObjectName("radioButton_2Dline")
        self.radioButton_2Dhist = QtWidgets.QRadioButton(self.groupBox_2D)
        self.radioButton_2Dhist.setGeometry(QtCore.QRect(108, 22, 59, 16))
        self.radioButton_2Dhist.setObjectName("radioButton_2Dhist")
        self.radioButton_2Dscatter = QtWidgets.QRadioButton(self.groupBox_2D)
        self.radioButton_2Dscatter.setGeometry(QtCore.QRect(10, 44, 59, 16))
        self.radioButton_2Dscatter.setObjectName("radioButton_2Dscatter")
        self.checkBox_histfit = QtWidgets.QCheckBox(self.groupBox_2D)
        self.checkBox_histfit.setEnabled(False)
        self.checkBox_histfit.setGeometry(QtCore.QRect(108, 44, 71, 16))
        self.checkBox_histfit.setObjectName("checkBox_histfit")
        self.gridLayout_8.addWidget(self.groupBox_2D, 1, 0, 1, 1)
        self.groupBox_fit = QtWidgets.QGroupBox(self.tab_3)
        self.groupBox_fit.setEnabled(False)
        self.groupBox_fit.setObjectName("groupBox_fit")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_fit)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.label_9 = QtWidgets.QLabel(self.groupBox_fit)
        self.label_9.setObjectName("label_9")
        self.gridLayout_2.addWidget(self.label_9, 0, 0, 1, 1)
        self.comboBox_fitmethod = QtWidgets.QComboBox(self.groupBox_fit)
        self.comboBox_fitmethod.setObjectName("comboBox_fitmethod")
        self.comboBox_fitmethod.addItem("")
        self.comboBox_fitmethod.addItem("")
        self.comboBox_fitmethod.addItem("")
        self.gridLayout_2.addWidget(self.comboBox_fitmethod, 1, 1, 1, 1)
        self.comboBox_2d_n = QtWidgets.QComboBox(self.groupBox_fit)
        self.comboBox_2d_n.setEnabled(False)
        self.comboBox_2d_n.setEditable(True)
        self.comboBox_2d_n.setObjectName("comboBox_2d_n")
        self.comboBox_2d_n.addItem("")
        self.comboBox_2d_n.addItem("")
        self.comboBox_2d_n.addItem("")
        self.comboBox_2d_n.addItem("")
        self.comboBox_2d_n.addItem("")
        self.gridLayout_2.addWidget(self.comboBox_2d_n, 2, 1, 1, 1)
        self.label_10 = QtWidgets.QLabel(self.groupBox_fit)
        self.label_10.setObjectName("label_10")
        self.gridLayout_2.addWidget(self.label_10, 1, 0, 1, 1)
        self.label_11 = QtWidgets.QLabel(self.groupBox_fit)
        self.label_11.setObjectName("label_11")
        self.gridLayout_2.addWidget(self.label_11, 2, 0, 1, 1)
        self.checkBox_fit = QtWidgets.QCheckBox(self.groupBox_fit)
        self.checkBox_fit.setEnabled(False)
        self.checkBox_fit.setText("")
        self.checkBox_fit.setObjectName("checkBox_fit")
        self.gridLayout_2.addWidget(self.checkBox_fit, 0, 1, 1, 1)
        self.gridLayout_8.addWidget(self.groupBox_fit, 1, 1, 2, 1)
        self.groupBox_3D = QtWidgets.QGroupBox(self.tab_3)
        self.groupBox_3D.setEnabled(False)
        self.groupBox_3D.setObjectName("groupBox_3D")
        self.radioButton_3Dline = QtWidgets.QRadioButton(self.groupBox_3D)
        self.radioButton_3Dline.setGeometry(QtCore.QRect(10, 37, 59, 16))
        self.radioButton_3Dline.setChecked(True)
        self.radioButton_3Dline.setObjectName("radioButton_3Dline")
        self.radioButton_3Dsurface = QtWidgets.QRadioButton(self.groupBox_3D)
        self.radioButton_3Dsurface.setGeometry(QtCore.QRect(147, 37, 59, 16))
        self.radioButton_3Dsurface.setObjectName("radioButton_3Dsurface")
        self.radioButton_3Dscatter = QtWidgets.QRadioButton(self.groupBox_3D)
        self.radioButton_3Dscatter.setGeometry(QtCore.QRect(79, 37, 59, 16))
        self.radioButton_3Dscatter.setObjectName("radioButton_3Dscatter")
        self.gridLayout_8.addWidget(self.groupBox_3D, 2, 0, 1, 1)
        self.groupBox = QtWidgets.QGroupBox(self.tab_3)
        self.groupBox.setObjectName("groupBox")
        self.gridLayout_7 = QtWidgets.QGridLayout(self.groupBox)
        self.gridLayout_7.setObjectName("gridLayout_7")
        self.lineEdit_datax = QtWidgets.QLineEdit(self.groupBox)
        self.lineEdit_datax.setObjectName("lineEdit_datax")
        self.gridLayout_7.addWidget(self.lineEdit_datax, 1, 1, 1, 1)
        self.label_8 = QtWidgets.QLabel(self.groupBox)
        self.label_8.setObjectName("label_8")
        self.gridLayout_7.addWidget(self.label_8, 1, 4, 1, 1)
        self.label_6 = QtWidgets.QLabel(self.groupBox)
        self.label_6.setInputMethodHints(QtCore.Qt.ImhNone)
        self.label_6.setScaledContents(False)
        self.label_6.setWordWrap(True)
        self.label_6.setObjectName("label_6")
        self.gridLayout_7.addWidget(self.label_6, 0, 0, 1, 6)
        self.lineEdit_dataz = QtWidgets.QLineEdit(self.groupBox)
        self.lineEdit_dataz.setEnabled(False)
        self.lineEdit_dataz.setObjectName("lineEdit_dataz")
        self.gridLayout_7.addWidget(self.lineEdit_dataz, 1, 5, 1, 1)
        self.lineEdit_datay = QtWidgets.QLineEdit(self.groupBox)
        self.lineEdit_datay.setObjectName("lineEdit_datay")
        self.gridLayout_7.addWidget(self.lineEdit_datay, 1, 3, 1, 1)
        self.label_7 = QtWidgets.QLabel(self.groupBox)
        self.label_7.setObjectName("label_7")
        self.gridLayout_7.addWidget(self.label_7, 1, 2, 1, 1)
        self.label_5 = QtWidgets.QLabel(self.groupBox)
        self.label_5.setObjectName("label_5")
        self.gridLayout_7.addWidget(self.label_5, 1, 0, 1, 1)
        self.gridLayout_8.addWidget(self.groupBox, 3, 0, 1, 2)
        self.groupBox_6 = QtWidgets.QGroupBox(self.tab_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox_6.sizePolicy().hasHeightForWidth())
        self.groupBox_6.setSizePolicy(sizePolicy)
        self.groupBox_6.setObjectName("groupBox_6")
        self.gridLayout_11 = QtWidgets.QGridLayout(self.groupBox_6)
        self.gridLayout_11.setObjectName("gridLayout_11")
        self.radioButton_2D = QtWidgets.QRadioButton(self.groupBox_6)
        self.radioButton_2D.setChecked(True)
        self.radioButton_2D.setObjectName("radioButton_2D")
        self.gridLayout_11.addWidget(self.radioButton_2D, 0, 0, 1, 1)
        self.radioButton_3D = QtWidgets.QRadioButton(self.groupBox_6)
        self.radioButton_3D.setObjectName("radioButton_3D")
        self.gridLayout_11.addWidget(self.radioButton_3D, 0, 1, 1, 1)
        self.gridLayout_8.addWidget(self.groupBox_6, 0, 0, 1, 2)
        self.tabWidget.addTab(self.tab_3, "")
        self.gridLayout_6.addWidget(self.tabWidget, 0, 0, 1, 10)
        self.saveDataButton = QtWidgets.QPushButton(self.centralwidget)
        self.saveDataButton.setObjectName("saveDataButton")
        self.gridLayout_6.addWidget(self.saveDataButton, 2, 6, 1, 1)
        spacerItem11 = QtWidgets.QSpacerItem(20, 40,
                                             QtWidgets.QSizePolicy.Minimum,
                                             QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_6.addItem(spacerItem11, 0, 10, 4, 1)
        spacerItem12 = QtWidgets.QSpacerItem(18, 20,
                                             QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_6.addItem(spacerItem12, 2, 0, 1, 1)
        spacerItem13 = QtWidgets.QSpacerItem(18, 20,
                                             QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_6.addItem(spacerItem13, 2, 7, 1, 1)
        spacerItem14 = QtWidgets.QSpacerItem(40, 20,
                                             QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_6.addItem(spacerItem14, 3, 0, 1, 10)
        self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
        self.textBrowser.setEnabled(True)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.textBrowser.sizePolicy().hasHeightForWidth())
        self.textBrowser.setSizePolicy(sizePolicy)
        self.textBrowser.setSizeAdjustPolicy(
            QtWidgets.QAbstractScrollArea.AdjustToContentsOnFirstShow)
        self.textBrowser.setReadOnly(True)
        self.textBrowser.setObjectName("textBrowser")
        self.gridLayout_6.addWidget(self.textBrowser, 4, 0, 1, 12)
        spacerItem15 = QtWidgets.QSpacerItem(17, 20,
                                             QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_6.addItem(spacerItem15, 2, 9, 1, 1)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        self.label_2.setObjectName("label_2")
        self.horizontalLayout_2.addWidget(self.label_2)
        self.filenameLabel = QtWidgets.QLabel(self.centralwidget)
        self.filenameLabel.setText("")
        self.filenameLabel.setObjectName("filenameLabel")
        self.horizontalLayout_2.addWidget(self.filenameLabel)
        spacerItem16 = QtWidgets.QSpacerItem(40, 20,
                                             QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem16)
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setObjectName("label")
        self.horizontalLayout_2.addWidget(self.label)
        self.fileformatLabel = QtWidgets.QLabel(self.centralwidget)
        self.fileformatLabel.setText("")
        self.fileformatLabel.setObjectName("fileformatLabel")
        self.horizontalLayout_2.addWidget(self.fileformatLabel)
        spacerItem17 = QtWidgets.QSpacerItem(40, 20,
                                             QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem17)
        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        self.label_3.setObjectName("label_3")
        self.horizontalLayout_2.addWidget(self.label_3)
        self.dataDimLabel = QtWidgets.QLabel(self.centralwidget)
        self.dataDimLabel.setText("")
        self.dataDimLabel.setObjectName("dataDimLabel")
        self.horizontalLayout_2.addWidget(self.dataDimLabel)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.tableWidget = DataTableWidget(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.tableWidget.sizePolicy().hasHeightForWidth())
        self.tableWidget.setSizePolicy(sizePolicy)
        self.tableWidget.setObjectName("tableWidget")
        self.verticalLayout.addWidget(self.tableWidget)
        self.gridLayout_6.addLayout(self.verticalLayout, 0, 11, 4, 1)
        self.pushButton_refresh = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_refresh.setObjectName("pushButton_refresh")
        self.gridLayout_6.addWidget(self.pushButton_refresh, 2, 1, 1, 1)
        spacerItem18 = QtWidgets.QSpacerItem(40, 20,
                                             QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_6.addItem(spacerItem18, 2, 2, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23))
        self.menubar.setObjectName("menubar")
        self.menu = QtWidgets.QMenu(self.menubar)
        self.menu.setObjectName("menu")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.menubar.addAction(self.menu.menuAction())

        self.retranslateUi(MainWindow)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        MainWindow.setTabOrder(self.tabWidget, self.pushButton_openfile)
        MainWindow.setTabOrder(self.pushButton_openfile,
                               self.pushButton_refresh)
        MainWindow.setTabOrder(self.pushButton_refresh, self.initDataButton)
        MainWindow.setTabOrder(self.initDataButton, self.saveDataButton)
        MainWindow.setTabOrder(self.saveDataButton, self.plotButton)
        MainWindow.setTabOrder(self.plotButton, self.radioButton_ignorenan)
        MainWindow.setTabOrder(self.radioButton_ignorenan,
                               self.radioButton_delnan)
        MainWindow.setTabOrder(self.radioButton_delnan,
                               self.radioButton_fillnan)
        MainWindow.setTabOrder(self.radioButton_fillnan, self.checkNaNButton)
        MainWindow.setTabOrder(self.checkNaNButton, self.okButton_nan)
        MainWindow.setTabOrder(self.okButton_nan, self.repealButton_nan)
        MainWindow.setTabOrder(self.repealButton_nan,
                               self.radioButton_ignorenondim)
        MainWindow.setTabOrder(self.radioButton_ignorenondim,
                               self.radioButton_zstandard)
        MainWindow.setTabOrder(self.radioButton_zstandard,
                               self.radioButton_01standard)
        MainWindow.setTabOrder(self.radioButton_01standard,
                               self.radioButton_normalizer)
        MainWindow.setTabOrder(self.radioButton_normalizer,
                               self.okButton_nondim)
        MainWindow.setTabOrder(self.okButton_nondim, self.radioButton_2D)
        MainWindow.setTabOrder(self.radioButton_2D, self.radioButton_3D)
        MainWindow.setTabOrder(self.radioButton_3D, self.radioButton_2Dline)
        MainWindow.setTabOrder(self.radioButton_2Dline,
                               self.radioButton_3Dline)
        MainWindow.setTabOrder(self.radioButton_3Dline, self.lineEdit_datax)
        MainWindow.setTabOrder(self.lineEdit_datax, self.lineEdit_datay)
        MainWindow.setTabOrder(self.lineEdit_datay, self.lineEdit_dataz)
        MainWindow.setTabOrder(self.lineEdit_dataz, self.textBrowser)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "数据分析工具"))
        self.initDataButton.setText(_translate("MainWindow", "数据初始化"))
        self.plotButton.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-size:8pt;\">根据绘图设置对当前数据集进行绘图</span></p></body></html>"
            ))
        self.plotButton.setText(_translate("MainWindow", "绘图"))
        self.pushButton_openfile.setText(_translate("MainWindow", "选择文件"))
        self.label_4.setText(_translate("MainWindow", "数据基本特征信息如下:"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab),
                                  _translate("MainWindow", "数据导入"))
        self.groupBox_2.setTitle(_translate("MainWindow", "缺失值处理"))
        self.radioButton_ignorenan.setText(_translate("MainWindow", "忽略"))
        self.radioButton_delnan.setToolTip(
            _translate("MainWindow",
                       "<html><head/><body><p>删除含缺失值的样本</p></body></html>"))
        self.radioButton_delnan.setText(_translate("MainWindow", "删除"))
        self.radioButton_fillnan.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p>使用对应特征均值来填充缺失值</p></body></html>"))
        self.radioButton_fillnan.setText(_translate("MainWindow", "均值代替"))
        self.checkNaNButton.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p>统计含有缺失值的样本数,并给出建议操作</p></body></html>"))
        self.checkNaNButton.setText(_translate("MainWindow", "检查NaN值"))
        self.repealButton_nan.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-size:8pt;\">撤回该操作</span></p></body></html>"
            ))
        self.repealButton_nan.setText(_translate("MainWindow", "撤回"))
        self.okButton_nan.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-size:8pt;\">执行该操作</span></p></body></html>"
            ))
        self.okButton_nan.setText(_translate("MainWindow", "确认"))
        self.groupBox_3.setTitle(_translate("MainWindow", "无量纲化处理"))
        self.initButton_nondim.setText(_translate("MainWindow", "撤回初始数据"))
        self.okButton_nondim.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-size:8pt;\">执行该操作</span></p></body></html>"
            ))
        self.okButton_nondim.setText(_translate("MainWindow", "确认"))
        self.repealButton_nondim.setToolTip(
            _translate("MainWindow",
                       "<html><head/><body><p>撤回该操作</p></body></html>"))
        self.repealButton_nondim.setText(_translate("MainWindow", "撤回上一步"))
        self.radioButton_ignorenondim.setText(_translate("MainWindow", "忽略"))
        self.radioButton_zstandard.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-family:\'-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif\'; font-size:8pt; color:#1a1a1a; background-color:#ffffff;\">基于特征值的均值(mean)和标准差(standard deviation)进行数据的标准化</span></p><p><span style=\" font-family:\'-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif\'; font-size:8pt; color:#1a1a1a; background-color:#ffffff;\">目的:1.对于方差非常小的属性可以增强其稳定性;2.维持稀疏矩阵中为0的条目。</span></p></body></html>"
            ))
        self.radioButton_zstandard.setText(_translate("MainWindow", "Z标准化"))
        self.radioButton_01standard.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-family:\'-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif\'; font-size:8pt; color:#1a1a1a; background-color:#ffffff;\">对原始数据进行线性变换,将特征值映射成区间为[0,1]的标准值中</span></p></body></html>"
            ))
        self.radioButton_01standard.setText(_translate("MainWindow", "归一化"))
        self.radioButton_normalizer.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-family:\'-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif\'; font-size:8pt; color:#1a1a1a; background-color:#ffffff;\">将每个样本缩放到单位范数(每个样本的范数为1)</span></p><p><span style=\" font-family:\'-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif\'; font-size:8pt; color:#1a1a1a; background-color:#ffffff;\">该方法主要应用于文本分类和聚类中。</span></p></body></html>"
            ))
        self.radioButton_normalizer.setText(_translate("MainWindow", "正则化"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2),
                                  _translate("MainWindow", "特征预处理"))
        self.groupBox_2D.setTitle(_translate("MainWindow", "2D绘图设置"))
        self.radioButton_2Dline.setText(_translate("MainWindow", "折线图"))
        self.radioButton_2Dhist.setText(_translate("MainWindow", "直方图"))
        self.radioButton_2Dscatter.setText(_translate("MainWindow", "散点图"))
        self.checkBox_histfit.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p>是否对柱状图中数据进行拟合</p></body></html>"))
        self.checkBox_histfit.setText(_translate("MainWindow", "密度曲线"))
        self.groupBox_fit.setTitle(_translate("MainWindow", "数据拟合"))
        self.label_9.setText(_translate("MainWindow", "是否拟合:"))
        self.comboBox_fitmethod.setItemText(0,
                                            _translate("MainWindow", "多项式拟合"))
        self.comboBox_fitmethod.setItemText(1,
                                            _translate("MainWindow", "e指数拟合"))
        self.comboBox_fitmethod.setItemText(2,
                                            _translate("MainWindow", "对数拟合"))
        self.comboBox_2d_n.setCurrentText(_translate("MainWindow", "1"))
        self.comboBox_2d_n.setItemText(0, _translate("MainWindow", "1"))
        self.comboBox_2d_n.setItemText(1, _translate("MainWindow", "2"))
        self.comboBox_2d_n.setItemText(2, _translate("MainWindow", "3"))
        self.comboBox_2d_n.setItemText(3, _translate("MainWindow", "4"))
        self.comboBox_2d_n.setItemText(4, _translate("MainWindow", "5"))
        self.label_10.setText(_translate("MainWindow", "拟合方式:"))
        self.label_11.setText(_translate("MainWindow", "拟合阶数:"))
        self.groupBox_3D.setTitle(_translate("MainWindow", "3D绘图设置"))
        self.radioButton_3Dline.setText(_translate("MainWindow", "折线图"))
        self.radioButton_3Dsurface.setText(_translate("MainWindow", "曲面图"))
        self.radioButton_3Dscatter.setText(_translate("MainWindow", "散点图"))
        self.groupBox.setTitle(_translate("MainWindow", "绘图数据"))
        self.lineEdit_datax.setText(_translate("MainWindow", "0"))
        self.label_8.setText(_translate("MainWindow", "z:"))
        self.label_6.setText(
            _translate(
                "MainWindow",
                "Tips: 请输入需要绘图的数据,可选择列标形式(从0开始)或者特征名称形式,如有多个特征,请用英文逗号,隔开!"))
        self.lineEdit_dataz.setText(_translate("MainWindow", "2"))
        self.lineEdit_datay.setText(_translate("MainWindow", "1"))
        self.label_7.setText(_translate("MainWindow", "y:"))
        self.label_5.setText(_translate("MainWindow", "x:"))
        self.groupBox_6.setTitle(_translate("MainWindow", "图像类型"))
        self.radioButton_2D.setText(_translate("MainWindow", "2D"))
        self.radioButton_3D.setText(_translate("MainWindow", "3D"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3),
                                  _translate("MainWindow", "绘图设置"))
        self.saveDataButton.setText(_translate("MainWindow", "保存数据"))
        self.label_2.setText(_translate("MainWindow", "文件名称:"))
        self.label.setText(_translate("MainWindow", "文件格式:"))
        self.label_3.setText(_translate("MainWindow", "数据维度:"))
        self.pushButton_refresh.setToolTip(
            _translate("MainWindow",
                       "<html><head/><body><p>刷新界面</p></body></html>"))
        self.pushButton_refresh.setText(_translate("MainWindow", "刷新"))
        self.menu.setTitle(_translate("MainWindow", "帮助"))
コード例 #2
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1030, 778)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        qss_file = open(os.getcwd() + '/resource/QSS/Mainwindow.qss').read()
        self.setStyleSheet(qss_file)


        self.centralWidget = QtWidgets.QWidget(MainWindow)
        self.centralWidget.setObjectName("centralWidget")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.centralWidget)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label_prov = QtWidgets.QLabel(self.centralWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_prov.sizePolicy().hasHeightForWidth())
        self.label_prov.setSizePolicy(sizePolicy)
        self.label_prov.setMinimumSize(QtCore.QSize(0, 0))
        self.label_prov.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.label_prov.setObjectName("label_prov")
        self.horizontalLayout.addWidget(self.label_prov)
        self.comboBox_prov = QtWidgets.QComboBox(self.centralWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.comboBox_prov.sizePolicy().hasHeightForWidth())
        self.comboBox_prov.setSizePolicy(sizePolicy)
        self.comboBox_prov.setMinimumSize(QtCore.QSize(0, 0))
        self.comboBox_prov.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.comboBox_prov.setObjectName("comboBox_prov")
        self.horizontalLayout.addWidget(self.comboBox_prov)
        self.label_city = QtWidgets.QLabel(self.centralWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_city.sizePolicy().hasHeightForWidth())
        self.label_city.setSizePolicy(sizePolicy)
        self.label_city.setMinimumSize(QtCore.QSize(0, 0))
        self.label_city.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.label_city.setObjectName("label_city")
        self.horizontalLayout.addWidget(self.label_city)
        self.comboBox_city = QtWidgets.QComboBox(self.centralWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.comboBox_city.sizePolicy().hasHeightForWidth())
        self.comboBox_city.setSizePolicy(sizePolicy)
        self.comboBox_city.setMinimumSize(QtCore.QSize(0, 0))
        self.comboBox_city.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.comboBox_city.setObjectName("comboBox_city")
        self.horizontalLayout.addWidget(self.comboBox_city)
        self.label = QtWidgets.QLabel(self.centralWidget)
        self.label.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.lineEdit_keyword = QtWidgets.QLineEdit(self.centralWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(self.lineEdit_keyword.sizePolicy().hasHeightForWidth())
        self.lineEdit_keyword.setSizePolicy(sizePolicy)
        self.lineEdit_keyword.setMinimumSize(QtCore.QSize(0, 0))
        self.lineEdit_keyword.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.lineEdit_keyword.setObjectName("lineEdit_keyword")
        self.horizontalLayout.addWidget(self.lineEdit_keyword)
        self.verticalLayout_2.addLayout(self.horizontalLayout)

        self.pandastablewidget = DataTableWidget(self.centralWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(self.pandastablewidget.sizePolicy().hasHeightForWidth())
        self.pandastablewidget.setSizePolicy(sizePolicy)
        self.pandastablewidget.setMinimumSize(QtCore.QSize(800, 600))
        self.pandastablewidget.setObjectName("pandastablewidget")
        self.verticalLayout_2.addWidget(self.pandastablewidget)
        self.verticalLayout_3.addLayout(self.verticalLayout_2)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.label_display = QtWidgets.QLabel(self.centralWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_display.sizePolicy().hasHeightForWidth())
        self.label_display.setSizePolicy(sizePolicy)
        self.label_display.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.label_display.setObjectName("label_display")
        self.horizontalLayout_3.addWidget(self.label_display)
        self.label_progress = QtWidgets.QLabel(self.centralWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_progress.sizePolicy().hasHeightForWidth())
        self.label_progress.setSizePolicy(sizePolicy)
        self.label_progress.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.label_progress.setText("")
        self.label_progress.setObjectName("label_progress")
        self.horizontalLayout_3.addWidget(self.label_progress)
        self.verticalLayout_3.addLayout(self.horizontalLayout_3)
        self.horizontalLayout_4.addLayout(self.verticalLayout_3)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.pushButton_crawl = QtWidgets.QPushButton(self.centralWidget)
        self.pushButton_crawl.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.pushButton_crawl.setObjectName("pushButton_crawl")
        self.horizontalLayout_2.addWidget(self.pushButton_crawl)
        self.pushButton_clear = QtWidgets.QPushButton(self.centralWidget)
        self.pushButton_clear.setSizeIncrement(QtCore.QSize(0, 0))
        self.pushButton_clear.setBaseSize(QtCore.QSize(0, 0))
        self.pushButton_clear.setStyleSheet("font: 9pt \"微软雅黑\";")
        self.pushButton_clear.setObjectName("pushButton_clear")
        self.horizontalLayout_2.addWidget(self.pushButton_clear)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.listWidget = QtWidgets.QListWidget(self.centralWidget)
        self.listWidget.setObjectName("listWidget")
        self.verticalLayout.addWidget(self.listWidget)
        self.horizontalLayout_4.addLayout(self.verticalLayout)
        
        
        MainWindow.setCentralWidget(self.centralWidget)
        self.menuBar = QtWidgets.QMenuBar(MainWindow)
        self.menuBar.setGeometry(QtCore.QRect(0, 0, 1030, 26))
        self.menuBar.setObjectName("menuBar")
        self.menu = QtWidgets.QMenu(self.menuBar)
        self.menu.setObjectName("menu")
        self.menu_2 = QtWidgets.QMenu(self.menuBar)
        self.menu_2.setObjectName("menu_2")
        self.menu_3 = QtWidgets.QMenu(self.menuBar)
        self.menu_3.setObjectName("menu_3")
        MainWindow.setMenuBar(self.menuBar)
        self.menu_3.addSeparator()
        self.menu_3.addSeparator()
        self.menuBar.addAction(self.menu.menuAction())
        self.menuBar.addAction(self.menu_2.menuAction())
        self.menuBar.addAction(self.menu_3.menuAction())

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

        outPutAction = QtWidgets.QAction(QtGui.QIcon(os.getcwd() + '/resource/spider.png'), '导出文件', self)
        outPutAction.triggered.connect(self.outPutFile)
        self.menu.addAction(outPutAction)

        # 设置窗口背景
        # win = QMainWindow()
        # palette = QPalette()
        # palette.setColor(QPalette.Background, Qt.black)
        # win.setPalette(palette)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label_prov.setText(_translate("MainWindow", "省    份"))
        self.label_city.setText(_translate("MainWindow", "城    市"))
        self.label.setText(_translate("MainWindow", "关键词"))
        self.label_display.setText(_translate("MainWindow", "抓取进度"))
        self.pushButton_crawl.setText(_translate("MainWindow", "开始抓取"))
        self.pushButton_clear.setText(_translate("MainWindow", "清空结果"))
        self.menu.setTitle(_translate("MainWindow", "导出结果"))
        self.menu_2.setTitle(_translate("MainWindow", "关于"))
        self.menu_3.setTitle(_translate("MainWindow", "联系我"))




    def outPutFile(self):
        print('开始运行导出程序')
        try:
                self.Filedialog = QtWidgets.QDialog(self.centralWidget)
                self.Filedialog.setFixedSize(600, 150)
                self.Filedialog.setWindowTitle('导出EXCEL文件')
                self.Filedialog.setModal(True)

                self.Dirlabel = QtWidgets.QLabel(self.Filedialog)
                self.Dirlabel.move(20, 40)
                self.Dirlabel.setFixedSize(70, 30)
                self.Dirlabel.setText('文件位置: ')

                self.DirlineEdit = QtWidgets.QLineEdit(self.Filedialog)
                self.DirlineEdit.move(100, 40)
                self.DirlineEdit.setFixedSize(350, 30)
                self.DirlineEdit.setText(os.getcwd())

                self.Filelabel = QtWidgets.QLabel(self.Filedialog)
                self.Filelabel.move(20, 100)
                self.Filelabel.setFixedSize(70, 30)
                self.Filelabel.setText('文件名称: ')

                self.FilelineEdit = QtWidgets.QLineEdit(self.Filedialog)
                self.FilelineEdit.move(100, 100)
                self.FilelineEdit.setFixedSize(350, 30)

                self.YesButton = QtWidgets.QPushButton(self.Filedialog)
                self.YesButton.move(470, 100)
                self.YesButton.setFixedSize(100, 30)
                self.YesButton.setText('确定')
                self.YesButton.clicked.connect(self.saveFileToExcel)

                self.browlButton = QtWidgets.QPushButton(self.Filedialog)
                self.browlButton.move(470, 40)
                self.browlButton.setFixedSize(100, 30)
                self.browlButton.setText('浏览')
                self.browlButton.clicked.connect(self.openFile)

                self.Filedialog.show()
        except Exception as e:
                print(e)