0
0 комментариев

Python 3.7.3, Windows.

[apcode language=»python»]

class Main(QtWidgets.QWidget, Ui_Form): 
    def __init__(self, parent=None):
        super(Main, self).__init__(parent)
        self.setupUi(self)
        self.pushButton.clicked.connect(self.subproce)
         self.checkBox.stateChanged.connect(
            lambda state=self.checkBox.isChecked(), no=1: self.selectBooks(state, no))
       def selectBooks(self, toggle, no):
        if toggle == QtCore.Qt.Checked:
            print(''.format(toggle, no))
            if no == 1:
                print(''.format(no))
                x = self.lineEdit_3.text()
        else:
            print(''.format(toggle, no))
            x = self.lineEdit_3.text()
    def subproce(self):
     global x
     x1 = x
     file = str(self.lineEdit.text()) + "/" + str(self.lineEdit_2)
     file_by = str(x1) + self.lineEdit_4.text()
     subprocess.call("pyuic5" + self.file + "-x" + self.file_by)

[/apcode]

Выдаёт ошибку [apcode language=»python»]

File "C:\py\import subprocess.py", line 81, in subproce
    x1 = x
NameError: name 'x' is not defined

[/apcode]

Решенный вопрос
Добавить комментарий