发布时间:2019-09-06 08:53:45编辑:auto阅读(3081)
>>> 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标签的几种方法
48907
47994
38765
35900
30323
27092
26103
20940
20758
19118
612°
687°
668°
675°
647°
615°
699°
762°
894°
1064°