python获取,,def anc():
python获取,,def anc():
def anc():passprint anc.__name__def timeit(func): def run(*argv): print "this function name is", func.__name__ if argv: ret = func(*argv) else: ret = func() return ret return run@timeitdef add(anc): print ancadd(1)for i in range(0,60): print("%02d"%i)
import inspectdef get_current_function_name(): return inspect.stack()[1][3]class MyClass: def function_one(self): print "%s.%s invoked"%(self.__class__.__name__, get_current_function_name())if __name__ == "__main__": myclass = MyClass() myclass.function_one()
python获取
相关内容
- 暂无相关文章
评论关闭