TypeError: descriptor '__init__' of 'super' object needs an argument

created at May 31, 2021, 4:13 p.m. views: 0

I meet this error when I am creating a basic pyqt window, the problem is:

I missed the round bracket () and the end of super function.

bellow is the wrong code:

class Window(QWidget):
    def __init__(self):
        super.__init__() # where error occurs
        self.setWindowTitle("PyQt6: SpinBOX")

the solution is to add the bracket () to function super.

Please log in to leave a comment.