Introduction
Python is a great general-purpose language that is pretty easy to learn. Visual Studio Code (VS Code) is an excellent code editor, and Python pairs wonderfully with it. In this article, I will be helping you get started with Python and VS Code to create a productive development environment.
Setup
Install Python
If you are using MacOS or Windows, visit the Python website to download the installer for your platform, and then install Python. If you are on Linux, Python is most likely already installed. If not, install Python through your package manager or compile from source. On Windows make sure to check Add Python to Path during setup.

Install VS Code
Now that you have Python installed, it is time to install VS Code.
Visit the VS Code download page and download the installer for your platform, and then install it the way you normally install apps. If you are on Linux, you could also install it through Snap, Flatpak, or through your graphical software manager. 
Install Useful VS Code Extensions
Open command prompt or PowerShell on Windows, or Terminal on MacOS and Linux, and run the commands below.
You could also do this manually, but this automates the process so that it takes less time.
The code below installs some useful VS Code extensions and then installs the Python formatter called black .
- Black is an awesome Python formatter that can be accessed by using the keyboard shortcut Ctrl-Shift-P and then typing format document, followed by pressing enter. You can also access it by using the keyboard shortcut for your platform.
- The Python extension and Pylance are amazing VS Code extensions to help boost your coding productivity.
- As noted on its extension page, the Intellicode Extension provides AI-assisted IntelliSense by showing recommended completion items for your code context.
- Finally, the Better Comments extension helps you with better syntax highlighting for comments. For example a comment you enter starting with the word “todo” will be highlighted in an orange color.
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension VisualStudioExptTeam.vscodeintellicode
code --install-extension aaron-bond.better-comments
pip install black
If you would like to install the extensions manually, here are the links:
After you have run the code above or have installed the extensions manually, follow these steps.
Open VS Code and select the gear icon.

Select Settings.
On the search box, type Python Formatting Provider and press enter.

Change the value from autopep8 to black.
Test Out VS Code
Now that VS Code is set up, we will test it out to make sure it works.
Open up VS Code if you closed it or you can use the window you already have open. Click on the explorer icon.
![]()
Select the new file button.

- In the textbox that appears, type
hello.pyand press enter. - Open up the created file in VS Code and paste
print("hello world")
Use the keyboard shortcut Ctrl+S to save your file.
Now use the keyboard shortcut ctr+~ (Control-Tilde) to launch the terminal and type the following:
python hello.py
After this, press enter. Hello world should appear in the terminal.
Great Job! 🙌 Everything should be set up!
Conclusion
You have just installed VS Code and created a development for Python!
Check back on TitusJTech and subscribe to my RSS feed for more tech articles, tutorials, and guides.
