I am trying to call a function in class A from One.py file in to Two.py file by using
from one import A
in this class A :in init function i am assigning a variable name i.e; self._fname=name. Now i am trying to call a function funC() from class A which uses the self._fname varible like below in Two.py
now=A()
now.funC()
when call this function i am getting an Attribute Error :Class A has no attribute '_fname'
func():
if self._fname:
print "found"
How can i resolve this problem.Is there any way that i can import Class A object from one.py to Two.py so by using that object i can access the 'fname' variable.
funCbut the (incomplete) definition offunc(),func()accesses the attributefnamebut the error message refers to_fname. It's hard to help here.