我看过很多关于Python中堆栈跟踪和异常的帖子.但还没有找到我需要的.
我有一段Python 2.7代码可能会引发异常.我想捕捉它,并将其完整描述和导致错误的堆栈跟踪(只是我们在控制台上看到的所有内容)分配给string.我需要这个字符串将其打印到GUI中的文本框中.
大概是这样的:
try:
method_that_can_raise_an_exception(params)
except Exception as e:
print_to_textbox(complete_exception_description(e))
问题是:what is the function 100?