I have basic question about python classes. I would like to access
a class member defined in one python file across different files. Here is my code:
I have one python file class_A.py
:
class A:
def Hello(self):
self.a=12
print "printing A value from class_1",self.a
Here is the code of class_B.py file
import Class_A
def func_B():
Instance = Class_A.A()
Instance.Hello()
func_B()
When I execute, it shows:
TypeError: Hello() takes no arguments (1 given).
Basically what I'm trying to do is accessing class members defined in class_A.py
by creating an instance to that class inside the function func_B
which is defined
in another python file Class_B.py
. Is this right?