Python Exception Handling: Catching Any Exception
- try: # code that may raise an exception except: # code to handle any exception
- try: # code that may raise an exception except Exception: # code to handle any exception of type Exception
- try: # code that may raise an exception except (Exception1, Exception2): # code to handle any exception of type Exception1 or Exception2
- try: # code that may raise an exception except Exception as e: # code to handle any exception of type Exception and use the exception object 'e' for further processing.
原文地址: http://www.cveoy.top/t/topic/mJan 著作权归作者所有。请勿转载和采集!