python method takes no arguments (1 given) code example
Example 1: python class typeerror module() takes at most 2 arguments (3 given)
this error is often due to the fact that the classes are at the same time modules
example:
let's create a file A.py (module) containing a class A and the same for B.
If B extend from A then to import class A into B we do:
from A_module import A_className
in our example:
the python code will be:
import A from A
class B(A):
....
Example 2: 1 positional arguments expected but 2 were given
#Happens when a function expects only 1 value to be passed through it
#But multiple are passed through
class thing(object):
def __init__(self):
pass
def function(self)
print("hello")
thingy = thing()
thingy.bind("<KeyPress>", thingy.function)
#You don't expect above to pass two values through, however it passes an event
#and self which is why it will give a positional argument error