Actually these are 2 questions. 1) Is there a general way to get the instance class name, so if I have a class
class someClass(object):
I would like an inline way that gives me the string "someClass"
2) Similar to functions. if I have
def someFunction(): .... print builtinMethodToGetFunctionNameAsString return
it will print 'someFunction'
The reason I'm looking for this is because I have some jungle of classes and subclasses, and for debugging I would like to print where I am, so to all the methods I would just like to add something along the line
print 'Executing %s from %s' %(getFunctionName,getClassName)
So, I am looking for a general command that knows the class and function where it is, so that I can copy and paste the line into all methods without having to write a separate line for each of them
source share