问题描述
从warnings
模块的文档:
#!/usr/bin/env python -W ignore::DeprecationWarning
如果您在 Windows 上:-W ignore::DeprecationWarning
作为参数传递给
Python。最好通过强制转换为int来解决问题。
(请注意,在 Python 3.2 中,默认情况下会忽略弃用警告。)
解决方法
我不断得到这个:
DeprecationWarning: integer argument expected,got float
如何让这条消息消失?有没有办法避免 Python 中的警告?