import traceback


def BBQ():
    traceback.print_stack()

 

引入 traceback 包,在某个函数中执行 traceback.print_stack()。

 

相关文章: