捕获所有异常

#!/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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-06-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-09-08
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案