Extract traceback info from an exception object

The answer to this question depends on the version of Python you’re using. In Python 3 It’s simple: exceptions come equipped with a __traceback__ attribute that contains the traceback. This attribute is also writable, and can be conveniently set using the with_traceback method of exceptions: raise Exception(“foo occurred”).with_traceback(tracebackobj) These features are minimally described as part … Read more

Customize dbstop in MATLAB

If you use the editor, you can set a stop as normal, right-click on it, select “set/modify condition” and enter the condition (the stop will turn from red to yellow). From command line, you can use dbstop in file if expression dbstop in file at location if expression e.g. dbstop in myFile at 200 if … Read more