Catching Exceptions with try..except : Error Exception : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Error Exception »

 

Catching Exceptions with try..except


try:
    # some python statements
except [ExceptionName]:
   # some error handling
else:
   # some other statement
finally:
   do something when all is done.

Standard Python Error Types

Exception             
StandardError         
ArithmeticError       
LookupError           
AssertionError        
AttributeError        
EOFError              
EnvironmentError      
FloatingPointError    
GeneratorExit         
IOError               
ImportError           
IndexError            
KeyError              
KeyboardInterrupt     
MemoryError           
NameError             
NotImplementedError   
OsError               
OverflowError         
ReferenceError        
StopIteration         
SyntaxError           
SystemError           
TypeError             
UnboundLocalError     
ValueError            
WindowsError          
ZeroDivisionError



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» Error Exception