python traceback 变量值

import sys
import traceback
import cgitb

def handleException(excType, excValue, trace):
    print 'error'
    cgitb.Hook(format="text")(excType, excValue, trace)

sys.excepthook = handleException

h = 1
k = 0

print h/k

 

posted @ 2016-04-01 16:12  tommy.yu  阅读(368)  评论(0编辑  收藏  举报