关于python中的命名警告及解决

错误信息:This inspection detects shadowing names defined in outer scopes.

检查到波浪处的单词已在函数外部定义。

解决:使用global关键字或nonlocal 关键字或改名

 

错误信息:spellchecker inspection helps locate typos and misspelled in your code,comments and literals, and fix them in one click.

拼写检查有助于查找代码中的拼写错误、注释和文字,并在一次单击中修复它们。

解决:选中单词 - 右键 - spelling - save to project-level dictionary

关于python中的命名警告及解决_第1张图片

 

错误信息:Variable in function should be lowercase.

函数中的变量应该是小写的。

解决:换成小写,或者更改设置

File - Settings - Editor - Inspections - Python - PEP 8 naming convention violation - ignored errors中添加N802\N803\N806

关于python中的命名警告及解决_第2张图片 

你可能感兴趣的:(python)