摘要: #!/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... 阅读全文
posted @ 2013-02-19 11:51 鸪斑兔 阅读(588) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2013-02-19 11:19 鸪斑兔 阅读(1647) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示