发布时间:2019-09-06 08:53:45编辑:auto阅读(2965)
>>> 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标签的几种方法
47863
46424
37314
34760
29332
25990
24945
19967
19564
18050
5806°
6433°
5947°
5975°
7080°
5926°
5963°
6456°
6418°
7798°