标签:except try inf print code import logs bsp nbsp
1 import sys 2 try: 3 a = 3 4 assert a > 4 5 except: 6 exc = sys.exc_info()#返回异常的元祖 7 print (exc)
sys.exc_info()可以捕获到任意异常
原文地址:http://www.cnblogs.com/themost/p/6821040.html