You have to already have these in your system:
- Python. Version 3.6+ is highly recommended.
- Official CPython from python.org
- Anaconda
- (Recommended) Miniconda
- Git.
- Visual Studio Code.
Simply run code .
in the command line inside the root folder of the project.
Conda and venv environments should already have been detected by Visual Studio Code. You just need to pick one to use. Three ways to do this:
- Use the Command Palette (Ctrl+Shift+O) —— Type Python: Select Interpreter.
- Click Select Python Environment option on the status bar.
- Configure the
python.pythonPath
key in the global/workspace settings.
- Use the Command Palette (Ctrl+Shift+O) —— Python: Select Linter
- Add
"python.linting<linter>Enabled": true
to the global/workspace settings.
Recommended linters:
- pylint
- mypy (an experimental optional static type checker for Python)
- This is really new to me, but it is already awesome enough to be highly recommende.
- One obvious benefit is the lower number of type-related bugs.
- Another one is the better-informed autocomplete.
- Add
"python.formatting.provider": "<formatter>"
to the global/workspace settings.
Formatters:
- autopep8 - A tool that automatically formats Python code to conform to the PEP 8 style guide.
- yapf - A formatter for Python files
- black - The Uncompromising Code Formatter
Format on save:
- Add
"editor.formatOnSave": true
to the global/workspace settings.
It is recommended to set the flag value for all unittest frameworks:
"python.unitTest.unittestEnabled": true
"python.unitTest.pyTestEnabled": false
"python.unitTest.nosetestsEnabled": false
Frameworks:
- unittest
- (Recommended) pytest - helps you write better programs
- nose - nose is nicer testing for python
When highlighting the variable/function/class of interest:
- Go to Definition: F12
- Peek Definition: Ctrl+Shift+F10
- Find all References: Shift+F12
- Rename Symbol: F2
- Trigger IntelliSense: Ctrl+Space
- Insert the selected member: Tab or Enter
- Pull up the terminal window: Ctrl+`
- Numbered Bookmark - Mark lines in the editor and easily jump to them. In Delphi style.
- Gitlens - Git supercharged
- autoDocstring - Generates python docstrings
- Keyboard Shortcut: ctrl + shift + 2
- neuron - An Interactive Programming Experience for Data Scientists
- WARNING: current not working in my environment. (There is an issue reporting the same problem.)