I am using python to call a method in one class that is in one file from a method in another class of other file
Suppose my file is abc.py
that contains
class data :
def values_to_insert(a,b):
......
......
another file is def.py
import abc
class values:
data=abc.data()
def sendvalues():
a=2
b=3
data.values(a,b)
When I run this file it gives an error: values() takes exactly 2 arguments (3 given)
If it's in a class, your method should be :
def values_to_insert(self, a, b):
You can read about the reasoning for this here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With