摘要:
#!/usr/bin/env python#coding:utf-8import sysdef show_caller(level=1): def show(func): def wrapper(*args, **kwargs): func(*args, **kwargs) print '{0.f_code.co_filename}:{0.f_lineno}'.format(sys._getframe(level)), "->", func.__name__ return wrapper return show... 阅读全文
摘要:
Frame objectsFrame objects represent execution frames. They may occur in traceback objects (see below).Special read-only attributes: f_back is to the previous stack frame (towards the caller), or None if this is the bottom stack frame; f_code is the code object being executed in this frame; f_locals 阅读全文