标签:
traceback模块被用来跟踪异常返回信息. 如下例所示:
1
2
3
4
5
|
import traceback try : raise SyntaxError, "traceback test" except : traceback.print_exc() |
将会在控制台输出类似结果:
1
2
3
4
|
Traceback (most recent call last): File "H:\PythonWorkSpace\Test\src\TracebackTest.py", line 3, in <module> raise SyntaxError, "traceback test" SyntaxError: traceback test |
标签:
原文地址:http://www.cnblogs.com/skying555/p/4451079.html