VS code编写Python代码,用turtle画图,程序能够正常执行,但pylint有报错:Module turtle has no xxx member

VS code 编写Python代码,用turtle画图,发现程序能够正常执行,但代码turtle下方有红色波浪线,鼠标放上去有错误提示:Module 'turtle' has no xxx member。虽不影响程序运行,但看着很不舒服。

VS code编写Python代码,用turtle画图,程序能够正常执行,但pylint有报错:Module turtle has no xxx member

搜索相关资料,找到解决办法:

在项目目录下找到.vscode目录,打开其中的{} settings.json添加下面的配置

"python.linting.pylintArgs": ["--generate-members"]

注意:如果上一行结尾没有逗号的,需要增加逗号,否则会报错。

VS code编写Python代码,用turtle画图,程序能够正常执行,但pylint有报错:Module turtle has no xxx member

问题解决:

VS code编写Python代码,用turtle画图,程序能够正常执行,但pylint有报错:Module turtle has no xxx member