在写Python代码的时候,,
经常看到一些deprecate的警告信息,,看到挺烦的..
后来google,查询到通过wanrings模块,,可以临时废止warnings信息...
import warningsdef fxn():
warnings.warn("deprecated", DeprecationWarning)with warnings.catch_warnings():
warnings.simplefilter("ignore")
fxn()
转载于:https://blog.51cto.com/mstools/1529522