clicked.connect() Error
The connect()
method expects a callable argument. When you write self.Soft_Memory()
you are making a call to that method, and the result of that call (None
, since you don't explicitly return anything) is what is being passed to connect()
.
You want to pass a reference to the method itself.
self.PB1.clicked.connect(self.Soft_Memory)
The answers from @DaveyH-cks and @user3419537 are correct, you should use a reference of the method, instead of calling it:
self.PB1.clicked.connect(self.Soft_Memory)
However, you might often need to pass arguments on those functions (I certainly do). On those situations, if you need to use args there's a workaround by using lambda.
self.PB1.clicked.connect(lambda: myfunction(self, arg1, True, "example", arg4))