在 Python 的 except 块中,我想打印错误消息但不希望程序停止执行,我知道我需要像这样做:
try:
1/0
except:
print errorMessage
在 except 部分,我希望能够像 Java 的 printStackTrace()
一样打印出堆栈信息。