【发布时间】:2020-12-23 21:55:06
【问题描述】:
我想 pylint app.py,它位于以下 github 存储库中:
https://github.com/rajas2716/Udacity_MachineLearning_Project.git
但它给出了以下消息
app.py:16:4: W1202: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
app.py:58:4: W1202: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
app.py:60:4: W1202: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
我在网上搜了一下,找到了这个
https://stackoverflow.com/questions/34619790/pylint-message-logging-format-interpolation#:~:text=Use%20%25%20formatting%20in%20logging%20functions,passing%20the%20parameters%20as%20arguments
所以,我改变了这个
LOG.info(f"Scaling Payload: \n{payload}")
到这里
LOG.info(f"Scaling Payload: \n %s",payload)
但 pylint 仍然显示与上面相同的消息
我很天真。 请告诉我该怎么做
【问题讨论】:
-
您找到问题的答案了吗?我也面临同样的问题。
标签: python logging parameters format pylint