S
Sullivan WxPyQtKinter
When debugging using 'print' statement, I usually want to print some
important values together with the function name as the context of the
values printed out. So my hope is that I could get the name of the
function.
Since every function object actually has a private __name__ attribute
that gives its name, but when I
print __name__
in a function, it usually print the public module-level __name__
attribute, ie, 'main', rather than the function level __name__. So how
could I refer to the function object per se, in the body of the
function itself?
important values together with the function name as the context of the
values printed out. So my hope is that I could get the name of the
function.
Since every function object actually has a private __name__ attribute
that gives its name, but when I
print __name__
in a function, it usually print the public module-level __name__
attribute, ie, 'main', rather than the function level __name__. So how
could I refer to the function object per se, in the body of the
function itself?