在另一台计算机上运行程序出错

问题描述 投票:0回答:1

我有一段代码可以在我的计算机上完美运行。我通过电子邮件将这段代码发送给了一位朋友,每当他运行它时,他都会得到一个TypeError,我已经删除了pySlot()装饰器。我已经尝试将pySlot()装饰器分类为QtCore.pylot()。它们都不起作用。这些是Stackoverflow上发布的解决方案。代码在我的计算机上运行完美但在我在朋友计算机上运行时会生成以下错误消息 - 我通过电子邮件将.py文件(通过将其附加到电子邮件中)发送给他

错误信息:

TypeError: connect() failed between clicked(bool) and on_generate_codes()

为什么会这样?

import pandas as pd
import numpy as np
import os 

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMessageBox

class Ui_Dialog(object):

    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(531, 403)
        Dialog.setFixedSize(531,403)
        self.groupBox = QtWidgets.QGroupBox(Dialog)
        self.groupBox.setGeometry(QtCore.QRect(20, 20, 251, 171))
        self.groupBox.setObjectName("groupBox")



    @pyqtSlot()
    def on_generate_codes(self):

        """ 
        This method belongs to the generate button on the Dialog box
        When a user presses the button, a spreadsheet titled 

        """

    @pyqtSlot()   
    def reconcile(self):

        """
        This method reconciles 
        """

    def retranslateUi(self, Dialog):
        _translate = QtCore.QCoreApplication.translate
        Dialog.setWindowTitle(_translate("Dialog", "Mywindow"))
        self.comboBox.setItemText(0, _translate("Dialog", "Mar"))


if __name__ == "__main__"
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Dialog = QtWidgets.QDialog()
    ui = UI_Dialog
    ui.setupUi(Dialog)
    Dialog.show()
    sys.exit(app.exec())
python user-interface pyqt pyqt5
1个回答
0
投票

当他从电子邮件中复制时,可能会有一些不可读的字符或额外的空格。我建议您将其保存在文件中并发送文件,而不是将您的代码放在电子邮件中。

© www.soinside.com 2019 - 2024. All rights reserved.