sys.exc_info()
sys.exc_info() is a Python function in the Sys Module category. Returns information about the exception currently being handled: (type, value, traceback). The syntax is sys.exc_info(). Returns: (type, value, traceback) tuple. A typical example: try:
1/0
except:
exc_type, exc_val, exc_tb = sys.exc_info()
print(exc_type) # . A close sibling is sys.argv, which a list of command-line arguments passed to a Python script. sys.argv[0] is the script name. A close sibling is sys.exit(), which exits the interpreter by raising SystemExit. arg can be an integer (exit code) or a string. A close sibling is sys.path, which a list of module search paths. Can be modified to add import directories. A close sibling is sys.version, which a string containing the Python interpreter version. More about this category: System-specific parameters and functions — argv, path, exit. Related Sys Module entries: sys.argv, sys.exit(), sys.path, sys.version, sys.platform, sys.stdin.