捕获所有异常
#!/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
标签:pytho 简单 int ... gpo class strong -- print
捕获所有异常
#!/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
标签:pytho 简单 int ... gpo class strong -- print
原文地址:https://www.cnblogs.com/hixiaowei/p/8487766.html