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

created at 05-31-2021 views: 164


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.

created at:05-31-2021
edited at: 06-28-2021: