I have a package containing a module called rigfuncs3.py
SDNpackage/
__init__.py
rigfuncs3.py
Code:
class rig():
def __init__(self, rigNumber, leftNozPlate, rightNozPlate, bottomNozPlate, row1_centre_focus):
self.rigNumber = rigNumber
self.leftNozPlate = leftNozPlate
self.rightNozPlate = rightNozPlate
self.bottomNozPlate = bottomNozPlate
self.row1_centre_focus = row1_centre_focus
def getRigName(self):
return self.rigNumber
A script called play_04.py imports the module rigfuncs from the package. Code:
from SDNpack2 import rigfuncs3
instantiation = rigfuncs3.rig(1,1000.0, 2000.0, 3000.0, 4000.0)
print(dir(instantiation))
rig_num = instantiation.getRigName()
When run play_04 I get the error:
AttributeError: 'rig' object has no attribute 'getRigName'
I have no idea why, any ideas?
rigis defined inrigfuncs.py? Also can you please update your code so that only the code needed to replicate the problem is provided? Could you also provide a folder-structure for your package? If you're using windows, move into the "root" directory of your package and issue the commandtree /fand give us that output as well.rigmultiple times). Please read through this help page and update your code accordingly so that we can help you find the root cause.