标签:style blog color io ar div sp log on
1. handle exception
import sys try: a=1/1 except Exception, e: print "failed", sys.exc_info()[0] else: print "no exception" finally: print "execute final"
2. print exception
try: raise Exception("aaa","bbb") #a=1/0 except Exception as e : print (type(e)) print(e.args) print (e)
标签:style blog color io ar div sp log on
原文地址:http://www.cnblogs.com/phoenix13suns/p/3978929.html