输出漂亮的堆栈跟踪。
prettystack的Python项目详细描述
漂亮的堆栈跟踪:
fromprettystackimportPrettyStackTemplateprettystack_template=PrettyStackTemplate().to_console()try:exception_raiser()exceptExceptionasexception:output(prettystack_template.current_stacktrace())
输出(在终端窗口上色):
<ipython-input-4-2d951494fd2a> [1]: function 'exception_raiser' /path/to/example1.py 5 : 6 : def exception_raiser(): --> 7 : raise CatchThis("Some kind of message") 8 : example1.CatchThis Some kind of docstring Some kind of message