捕获所有异常
#!/usr/bin/python
a = 10
b = 0
try:
c = a/b
print c
print ‘nothing happen...‘
#todo: catch all exception
except Exception,e:
print ‘bad sth happen...‘,Exception,":",e
捕获所有异常
#!/usr/bin/python
a = 10
b = 0
try:
c = a/b
print c
print ‘nothing happen...‘
#todo: catch all exception
except Exception,e:
print ‘bad sth happen...‘,Exception,":",e
原文:https://www.cnblogs.com/hixiaowei/p/8487766.html