except里再try。 try: 语句A except Exception as e: try: 语句A except Exception as e: # 继续 但这样很蠢,如果你真想实现无限循环捕获异常的话,这么写吧: def func(): try: 语句A except Exception as e: return False else: return True while not func(): pass # Or do something
except里再try。
但这样很蠢,如果你真想实现无限循环捕获异常的话,这么写吧: