python异常处理(最基本)
#基本语法
try: """ function """ #捕获异常(不知道异常类型是什么) except Exception as a: print(a) #知道异常类型是什么 except FileNotFoundError: print("文件找不到") else: print("没有异常")
本文来自博客园,作者:会飞的大斗篷,转载请注明原文链接:https://www.cnblogs.com/sherlockids/p/15014120.html
#基本语法
try: """ function """ #捕获异常(不知道异常类型是什么) except Exception as a: print(a) #知道异常类型是什么 except FileNotFoundError: print("文件找不到") else: print("没有异常")
本文来自博客园,作者:会飞的大斗篷,转载请注明原文链接:https://www.cnblogs.com/sherlockids/p/15014120.html