标签:os io for div 代码 log sp line on
代码为:
if __name__ == ‘__main__‘:
try:
cc = 10/0
except:
import sys,traceback
print ‘begin‘
print ‘‘.join(traceback.format_exception(*sys.exc_info()))
print ‘end‘
=====获取的输出如下:
begin
Traceback (most recent call last):
File "G:\codetestcase\python_code\python_case_5\src\log\help.py", line 32, in <module>
cc = 10/0
ZeroDivisionError: integer division or modulo by zero
end
标签:os io for div 代码 log sp line on
原文地址:http://www.cnblogs.com/haibianxiaolu/p/3939292.html