(type, exc, tb)
return f'Traceback (most recent call last):\n{tb}{type.__name__}: {exc}'
Returns a traceback that looks like the one python gives you in the shell, e.g.

    Traceback (most recent call last):
      File "<stdin>", line 2, in <module>
    NameError: name 'name' is not defined
Returns a traceback that looks like the one python gives you in the shell, e.g.
Returns a traceback that looks like the one python gives you in the shell e . g .
def format_traceback_the_way_python_does(type, exc, tb):
    """
    Returns a traceback that looks like the one python gives you in the shell, e.g.

    Traceback (most recent call last):
      File "<stdin>", line 2, in <module>
    NameError: name 'name' is not defined
    """
    tb = ''.join(traceback.format_tb(tb))
    return f'Traceback (most recent call last):\n{tb}{type.__name__}: {exc}'
def format_traceback_the_way_python_does ( type , exc , tb ) : tb = '' . join ( traceback . format_tb ( tb ) ) return f'Traceback (most recent call last):\n{tb}{type.__name__}: {exc}'