Use a module called traceback
import traceback try: hoge() except: print traceback.format_exc()
Recommended Posts