美文网首页
python 打印堆栈信息

python 打印堆栈信息

作者: 远行_2a22 | 来源:发表于2019-12-11 13:15 被阅读0次
import traceback
traceback.print_stack()

比如:

import traceback

def fun1():
    fun2()

def fun2():
    fun3()

def fun3():
    traceback.print_stack()

fun1()

输出


image.png

相关文章

网友评论

      本文标题:python 打印堆栈信息

      本文链接:https://www.haomeiwen.com/subject/myuogctx.html