traceback.print_exc()
直接打印
可接受file参数直接写入到一个文件中
比如 traceback.print_exc(file = open(‘tb.txt’, ‘w+’))
traceback.format_exc()
返回字符串
python 捕获异常并打印 traceback
最新推荐文章于 2024-05-21 09:47:28 发布
traceback.print_exc()
直接打印
可接受file参数直接写入到一个文件中
比如 traceback.print_exc(file = open(‘tb.txt’, ‘w+’))
traceback.format_exc()
返回字符串