One
https://code.visualstudio.com/
Second, install the Python plugin
Open Vscode,ctrl+p
Enter "ext install python", the search time may be longer
Select the most downloaded plugin click Install
To this side vscode can edit the Python code, edit the code by F5 to run. The first run will allow you to choose the environment and Python.
The default press F5 after the need to press the F5 program to run, if you want to press F5 run immediately need to Launch.json file "Stoponentry": true, Change to "Stoponentry": false.
Introduce a plugin, vscode-icons can make Vscode to the left of the explorer based on the file type display icon
Third, configuration Flake8
When you write code after installing Flake8, the editor will prompt you for errors, and the code format will prompt
Open command Line
Enter "Pip Install Flake8"
After the installation of Flake8 is successful, open Vscode, file, preferences, user settings, enter "Python.linting.flake8Enabled" in the Settings.json file: True
Iv. Configuration Yapf
Automatically format code by pressing ALT+SHIFT+F in Vscode after installing YAPF
Open command Line
Enter "Pip Install YAPF"
After the installation of YAPF is successful, open Vscode, file, preferences, user settings, enter "Python.formatting.provider" in the Settings.json file: "Yapf"
Five, a few tips
1. View the definition of a function or class
CTRL + left mouse click on the function name or class name to jump to the definition, the function name or the class name by pressing F12 can also achieve the same function
2. Change the variable name
Rename a variable by pressing F2 on the variable name
3. Python Breakpoint debugging
Click on the left side of the line number to set breakpoints, and on the left side of the debug screen you can see the variable changes
4. Hide the menu bar
This is a personal habit, if you also feel that the menu bar is very annoying, you can click on the view---toggle menu bar, can hide the menu bar. Press the ALT key when you need the menu bar to view
5. Set shortcut keys
File, preferences, keyboard shortcuts, copy the contents of the entire curly brace of the desired modifier shortcut to the right Keybindings.json file, and then modify the value of "key" to the shortcut you need. I only modified the shortcut keys for copying one row and deleting a row.
Vscode installation Use (Python)