import traceback

try:
    raise ValueError
except:
    tb = traceback.format_exc()
else:
    tb = "No error"
finally:
    print tb

Original: http://stackoverflow.com/questions/4564559/get-exception-description-and-stack-trace-which-caused-an-exception-all-as-a-st

相关文章:

  • 2021-10-15
  • 2022-01-02
  • 2022-12-23
  • 2021-06-13
  • 2021-12-20
  • 2021-06-16
猜你喜欢
  • 2022-01-09
  • 2021-10-21
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2021-06-17
相关资源
相似解决方案