I am new to object oriented world and trying following code in python and calling function of one class from another class.
Mycode.py
class A:
def funcA():
return "sometext"
def funcB(self):
self.funcA() # calls func A internally from funcB
secondcode.py
from Mycode import A
class B:
def funcC(self):
A.funcB(self) # it gives error for call funcA() as it is unknown to class B
if __name__ == '__main__':
b=B()
b.funcC()
AttributeError: 'B' object has no attribute 'funcA' How does scoping work with respect to classes in python?