1. try: # code that may raise an exception except: # code to handle any exception
  2. try: # code that may raise an exception except Exception: # code to handle any exception of type Exception
  3. try: # code that may raise an exception except (Exception1, Exception2): # code to handle any exception of type Exception1 or Exception2
  4. 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.
Python Exception Handling: Catching Any Exception

原文地址: http://www.cveoy.top/t/topic/mJan 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录