python Two very important functions are provided to deal with python Exceptions and errors in the operation of the program . You can use this function to debug python Program
When a novice writes code , We often encounter code errors , Many of my friends are not good at English , I don't know what it means to report an error ? Now we are sorting out an exception type
Exception name
describe
BaseException
The base class for all exceptions
SystemExit
The interpreter requests exit
KeyboardInterrupt
User interrupt execution ( Usually the input ^C)
Exception
Regular error base class
StopIteration
Iterators have no more values
GeneratorExit
generator (generator) An exception occurs to notify the exit
StandardError
All built-in standard exception base classes
ArithmeticError
Base class for all numerical errors
FloatingPointError
Floating point error
OverflowError
The numerical operation exceeds the maximum limit
ZeroDivisionError
except ( Or modulus ) zero ( All data types )
AssertionError
Assertion statement failed
AttributeError
Object does not have this property
EOFError
No built-in input , arrive EOF Mark
EnvironmentError
Base class for operating system errors
IOError
Input / Output operation failed
OSError
Operating system error
WindowsError
System call failed
ImportError
The import module / Object failed
LookupError
Base class for invalid data query
IndexError
There is no index in the sequence (index)
KeyError
There is no key in the map
MemoryError
Memory overflow error ( about Python The interpreter is not fatal )
NameError
Not a statement / Initialize object ( There is no attribute )
UnboundLocalError
Accessing an uninitialized local variable
ReferenceError
Weak reference (Weak reference) Trying to access a garbage collected object
RuntimeError
General runtime errors
NotImplementedError
A method that has not yet been implemented
SyntaxError
Python Grammar mistakes
IndentationError
The indentation error
TabError
Tab Mixed with Spaces
SystemError
General interpreter system error
TypeError
Invalid operation on type
ValueError
Invalid parameter passed in
UnicodeError
Unicode Related errors
UnicodeDecodeError
Unicode Error in decoding
UnicodeEncodeError
Unicode Error in coding
UnicodeTranslateError
Unicode Error in conversion
Warning
The base class for warnings
DeprecationWarning
A warning about abandoned features
FutureWarning
A warning about future semantic changes in construction
OverflowWarning
Old about auto promotion to long form (long) Warning of
PendingDeprecationWarning
A warning that features will be discarded
RuntimeWarning
Suspicious runtime behavior (runtime behavior) Warning of
SyntaxWarning
A dubious grammatical warning
UserWarning
Warnings generated by user code