Aug-16-2018, 01:34 PM
This will be about VS Code.
Will take if start,so get Python up running with some advice that make it easy to run code.
I has quick review before to look at here.
That also show some basic stuff about the editor.
Like hire @don Jayamanne the maker of Python Extension for VS Code.
VS Code is a multi-language editor that is same league as Atom and Sublime Text.
Start
Should make sure that
This will make setup in editor and stuff like virtual environment easier.
Python 3.6/3.7 and pip installation under Windows
Install
Install choose user installer.
After install the first ting to do is install needed Extension.
Here list of needed and some useful Extension.
Can also use Marketplace to find and install extensions.
Setup
Now gone do some setup to
![[Image: 7XwKWx.jpg]](https://imageshack.com/a/img922/8488/7XwKWx.jpg)
Search in setting
Click on the pen so on right side(user setting) so this is the result.
Can click on to change to other python interpreter installed like eg Anaconda.
Search setting
Install of modules command line for format code and linter.
Command platte search
Run Code
![[Image: lPKP5X.jpg]](https://imageshack.com/a/img922/2352/lPKP5X.jpg)
Start VS Code from any folder,eg for a virtual environment
With
Example with virtual environment that build into Python venv
So push run button it will use Python version in virtual environment.
![[Image: 51qWOg.jpg]](https://imageshack.com/a/img923/2927/51qWOg.jpg)
This was basic setup will post more stuff later.
Will take if start,so get Python up running with some advice that make it easy to run code.
I has quick review before to look at here.
That also show some basic stuff about the editor.
Quote:Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and LinuxThey have but a lot of resources to make Python work well in there editor.
Like hire @don Jayamanne the maker of Python Extension for VS Code.
VS Code is a multi-language editor that is same league as Atom and Sublime Text.
Start
Should make sure that
python
and pip
work from command line,before install.This will make setup in editor and stuff like virtual environment easier.
Python 3.6/3.7 and pip installation under Windows
C:\code λ python -V Python 3.7.0 C:\code λ pip -V pip 18.0 from c:\python37\lib\site-packages\pip (python 3.7)Linux if
python3
point to Python 3 use that in setup later.Install
Install choose user installer.
After install the first ting to do is install needed Extension.
Here list of needed and some useful Extension.
Can also use Marketplace to find and install extensions.
- python
- Python Extension Pack
- Code Runner
- vscode-icons
- Bracket Pair Colorizer
- highlight-icemode
- PlasticAB # My Theme
Setup
Now gone do some setup to
Code runner
and install some stuff so PEP-8 format of code and linter work.![[Image: 7XwKWx.jpg]](https://imageshack.com/a/img922/8488/7XwKWx.jpg)
Search in setting
code-runner.executorMap
Click on the pen so on right side(user setting) so this is the result.
"php": "php", "python": "$pythonPath $fullFileName", "perl": "perl",This make Code runner button always use Python interpreter down in left corner(see image).
Can click on to change to other python interpreter installed like eg Anaconda.
Search setting
code-runner.runInTerminal
and set it to True,make stuff like input() work in Code runner.Install of modules command line for format code and linter.
pip install autopep8 yapf black pip install pylintSearch setting
python.formatting.provider
to choose formater.Command platte search
pylint
to turn on/off,it can be annoying to have on alle time.Run Code
![[Image: lPKP5X.jpg]](https://imageshack.com/a/img922/2352/lPKP5X.jpg)
Start VS Code from any folder,eg for a virtual environment
With
code .
from command line in any folder will open files in that folder in VS Code.Example with virtual environment that build into Python venv
# Make E:\div_code λ python -m venv my_env # cd in E:\div_code λ cd my_env # Activate E:\div_code\my_env λ E:\div_code\my_env\Scripts\Activate # Test pip (my_env) E:\div_code\my_env λ pip -V pip 10.0.1 from e:\div_code\my_env\lib\site-packages\pip (python 3.7 # Install required package (my_env) E:\div_code\my_env λ pip install requests Collecting requests # Start VS Code (my_env) E:\div_code\my_env λ code .See now that it automatically find Python interpreter in virtual environment.
So push run button it will use Python version in virtual environment.
![[Image: 51qWOg.jpg]](https://imageshack.com/a/img923/2927/51qWOg.jpg)
This was basic setup will post more stuff later.