发布时间:2019-09-06 08:53:45编辑:auto阅读(3181)
>>> import warnings
>>>
>>> warnings.filterwarnings('error')
>>>
>>> try:
... warnings.warn(Warning())
... except Warning:
... print 'Warning was raised as an exception!'
...
Warning was raised as an exception!
参考资料:
2、https://docs.python.org/2/library/warnings.html
上一篇: 使用Python写Windows Ser
下一篇: python 去除html标签的几种方法
50973
50356
40971
37840
32303
29194
28080
22910
22873
21205
1074°
1751°
1433°
1368°
1638°
1454°
2113°
3660°
3592°
2529°