python - 如何忽略 Python 中的弃用警告

我不断收到这个:

DeprecationWarning: integer argument expected, got float

如何让这条消息消失?有没有办法避免 Python 中的警告?

最佳答案

你应该只是修复你的代码,但以防万一,

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning) 

https://stackoverflow.com/questions/879173/

相关文章:

python - 运行 `pip install` 的 Ubuntu 给出错误 'The follo

python - 如何在 Python 中使用省略号切片语法?

linux - rsync 使用包含选项仅复制某些类型的文件

linux - 如何在网络上的 2 个文件夹中获取所有文件之间的差异?

linux - fork: retry: 资源暂时不可用

linux - 异步 shell 命令

python - 在 virtualenv 中设置环境变量

linux - 无法连接到位于 unix :/var/run/docker. sock 的 Dock

linux - 目录上次修改日期

python - 我可以为 requests.request 设置 max_retries 吗?