Very simple class(source below) written in Python.
After constructing obj1 = myClass(12) and calling class function obj1.printInfo(), I am getting an error - AttributeError: type object 'myClass' has no attribute 'arg1' What might be the source of the problem ??
class myClass(object):
def __init__(self, arg1, arg2 = 0):
self.arg1 = arg1
self.arg2 = arg2
def printInfo (self):
print myClass.arg1, myClass.arg2
obj1 = myClass(12)
obj1.printInfo()
Thanks !