Eliminate wavy lines and yellow warnings in pycharm

As far as I can see, the wavy lines in pycharm have 3 colors: yellow, green and red
Insert picture description here

Yellow wavy line:

It is to remind users that the code is not standardized.
Solution: Use the Reformat Code function under the Code menu .
Of course, the formatting shortcut is more convenient: Ctrl+Alt+L

The following are some code standards in pycharm :
there must be two blank lines before and after the function definition, and there must be a space on both sides of the operators such as =, +, *, /, and # when used as a comment, leave it behind If a space is not at the beginning of the line, leave two spaces in front of it, and so on.
For details, please see:
https://www.cnblogs.com/liangmingshen/p/9273413.html
https://www.cnblogs.com/kendrick/p/5132274.html

Green wavy line

For details, please see:
https://blog.csdn.net/u011377894/article/details/106258955

Red wavy line

Indicates a grammatical error, and you need to carefully check what the problem is.

Yellow warning

#The following method is not reliable:
you can add two lines of code to the header of the table to import and execute the package that ignores warnings, and all warnings will be hidden when running~~
###########Ignore warnings

import warnings
warnings.filterwarnings("ignore")

I checked for a long time and finally used the right method.
Pycharm ignores the warning and restores the warning settings:
File | Settings | Inspections-Python-Unresolved references). After
Insert picture description here
removing the selected tick, the warning is eliminated~~~~:
Insert picture description here

For details of various warnings, please see:
https://pep8.readthedocs.io/en/latest/intro.html#configuration
Insert picture description here

Guess you like

Origin blog.csdn.net/langezuibang/article/details/114002062