Is there an easy way to get the message that the exception will be colored on the command line? for example
def g(): f() def f(): 1/0 g()
Gives an error
Traceback (most recent call last): File "test.py", line 3, in <module> g() File "test.py", line 1, in g def g(): f() File "test.py", line 2, in f def f(): 1/0 ZeroDivisionError: integer division or modulo by zero
I would like for “ integer division or modulo zero ” to be colored or highlighted on the terminal so that I can quickly select it from a long trace (Linux only). Ideally, I would not want to write a custom class for each Exception, but somehow caught and formatted all kinds.
EDIT: The question related to comments contains examples of how to solve the problem with external software, but I'm interested in the internal Python solution.
Hooked
source share