#基本语法
try: """ function """ #捕获异常(不知道异常类型是什么) except Exception as a: print(a) #知道异常类型是什么 except FileNotFoundError: print("文件找不到") else: print("没有异常")
python异常处理(最基本)
原文:https://www.cnblogs.com/sherlockids/p/15014120.html