why / ValueError:太多的值无法解包

时间:2020-07-17 20:14:04

标签: python

错误:

ValueError: too many values to unpack (expected 1)
in this line
FORM_CLASS, = loadUiType(path.join(path.dirname(__file__), "main.ui"))

有人可以解释为什么吗?

from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType

import os
from os import path
import sys

FORM_CLASS, = loadUiType(path.join(path.dirname(__file__), "main.ui"))

class MainApp(QMainWindow , FORM_CLASS):
    def __init__(self,parent=None):
        super(MainApp,self).__init__(parent)
        QMainWindow.__init__(self)
        self.setupUi(self)

def main():
    app = QApplication(sys.argv)
    window = MainApp()
    app.exec_()

if __name__ == '__main__':
    main()

0 个答案:

没有答案