I have the following code, where from cool_function() I'd like to call somefunc()
class MyKlass:
# This function is to be internally called only
def somefunc(self,text):
return (text + "_NEW")
@staticmethod
def cool_function(ixdirname, ixname):
tmp = self.somefunc(ixname)
print ixdirname, ixname, tmp
return
tmp = MyKlass.cool_function("FOODIR","FOO")
The result I want it to print out is:
FOODIR, FOO, FOO_NEW
What's the way to do it? Currently it prints this:
tmp = self.somefunc(ixname)
NameError: global name 'self' is not defined
somefuncan instance method?cool_functionbear onMyKlass?