1 #!/usr/bin/env python 2 #coding=utf-8 3 import traceback 4 5 try: 6 1/0 7 except Exception, e: 8 print e 9 print traceback.format_exc()