i'm trying to run a simple python script, but somehow i got this error:
AttributeError: 'Script' object has no attribute 'run'
My code looks like this:
class Script(object):
def __init__(self, data1, data2, data3):
self.data1 = data1
self.data2 = data2
self.data3 = data3
def getData1(self):
return self.data1
def getData2(self):
return self.data2
def getData3(self):
return self.data3
def run(self):
return 'Running successfully'
script1 = Script('data1', 'data2', 'data3')
print script1.run()
Would be great if someone can help me :)
__init__method rather than in the class. De-denting them by 1 level should fix your problem.