Python beginner, define urlconfig receive parameters, normal pass parameters, appear, give a parameter error problem,
After defining the function of class, it appears "' takes exactly 1 argument (2 given) ' Python error" at the time of the call.
After querying interesting ' takes exactly 1 argument (2 given) ' Python error, the original in Python, when using instance to invoke its class method, is quite the same as adding itself as the first argument in the call. As follows:
A.method (k)
is quite the same as:
A.method (A, k)
So, when you define a function, you need to first define self in the internal parameters of the function, such as:
Class Person ():
Def method (self, k):
...
If you want to call as a static function, you can identify it by adding "@staticmethod" above the definition function.
Thank you for reading, I hope to help you, thank you for your support for this site!