# -*- coding: utf-8 -*-
# @Time:2022/4/6 0:11
# @Author:Zeng 20181101145
# @File:异常处理.py
# @Software:PyCharm
#
# try:
# print("111")
# f=open("123.txt","r")
# print("222")#出错后不会执行
# except (IOError,NameError) as result:#将可能的错误类型放到括号中
# pass
# print(result)
#用Exception补货所有异常
'''
try:
print("111")
f=open("123.txt","r")
print("222")#出错后不会执行
except Exception as result:#将可能的错误类型放到括号中
pass
print(result)
'''
#try和finally
try:
f = open("123.txt", "r")
except Exception:
pass
finally:
print("出错喽")