赞
踩
try:
with open("123.txt") as f:
content = f.read()
try:
content[0] = "a"
except FileNotFoundError:
print("文件未发现错误")
except BaseException as error:
print("出现异常:%s" % error)
def func1(): print("----func1-1----") print(num) print("----func1-2----") def func2(): try: print("----func2-1----") func1() print("----func2-2----") except: print("test2出现异常") print("----func2-3----") func2() print("------华丽的分割线-----")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。