打印python的堆栈stack,, import
打印python的堆栈stack,, import
import sysdef pstack(depth = 0): frame = sys._getframe(depth) cnt = 0 while frame: print "###", cnt, frame.f_code.co_name, frame.f_code.co_filename, frame.f_lineno frame = frame.f_back cnt = cnt + 1def test(): pstack(0) print "-"*20 pstack(1)if __name__ == "__main__": test()
打印python的堆栈stack
相关内容
- 暂无相关文章
评论关闭