python异常捕获异常堆栈输出

学习了:https://blog.csdn.net/chris_grass/article/details/77927902

import traceback
def fun(a,b):
    return a/b
try:
    fun(1,0)
except Exception as e:
    traceback.print_exc()

 

相关文章:

  • 2021-04-17
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
猜你喜欢
  • 2021-09-25
  • 2021-11-22
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2023-03-06
  • 2022-03-08
相关资源
相似解决方案