Python with VS Code
Python with VS Code
We will learn how to program Python *.py in VS Code.
We want to make sure VSCode recognizes the Anaconda installation so it can access installed packages for autocomplete, syntax highlighting, and error checking.
Prerequisite
Anacond and Conda Virtual Environment : e.g. py37
Python and Numpy Installed by Conda
​
1. Install Python Extension
Open VS Code
Press Extension Icon or Press <
Ctrl
+Shift
+X
>Install Python (Microsoft)

2. Programming Python in VSCode
Open Working Folder in VS Code
Create a new test folder
Example:
\Tutorial_pythonOpenCV
Open the folder in VS Code

Select Interpreter
Let's select the virtual environment for this tutorial.
Assumed we already have created Conda Environment.
Press F1
> 'Python: Select Interpreter' > Choose py37
as the Interpreter

Run Test Code
(1) Create a new file
(2) Name the file as TU_pytest.py
(3) Program the code
(4) Run Python File
(5) It should give the output as
[1 4 9]

Further Reading
Last updated
Was this helpful?