📜  如何排除 Python 尝试语句中的每个错误 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:26.174000             🧑  作者: Mango

代码示例1
try:
    print "Performing an action which may throw an exception."
except Exception, error:
    print "An exception was thrown!"
    print str(error)
else:
    print "Everything looks great!"
finally:
    print "Finally is called directly after executing the try statement whether an exception is thrown or not."