[Solution] Python: Get rid of errors like: TypeError: takes exactly 1 argument (2 given)

If you get exceptions like
TypeError: myFunction() takes exactly 1 argument (2 given)
in Python, they probably result from code parts like
class myClass: def myFunction(myParameter):
that cause the interpreter to fire this strange error message into your debugging console. To solve this problem you simply have to add a further parameter to your function:
class myClass: def myFunction(self, myParameter):

No comments:

Post a Comment