在try … exception中显示traceback…:

import traceback
try:
    1 + 'a'
except Exception as e:
    tb = traceback.format_exc()
    print(tb)

 

posted @ 2018-05-16 14:19  wangheng1409  阅读(104)  评论(0)    收藏  举报