Introduction
I want to standardize things a little bit with vscode. So I am writing this post.
Microsoft vscode
It’s Free, little bit open source, but owned by Bill Gates. So don’t get use it. So far I like it a lot because of plugins and most importantly it has in built git support.
Get started
- Install vscode
- Open a folder for your code
- Save the folder as workspace (
File
–>save as workspace
) Workspace stores all your folders and settings in the file. So next time you can just open the workspace file. - Download extensions, icon is on the left
Extensions
-
Python extension pack
This extension pack packages some of the most popular Python extensions.
- Python - Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, Data Science (with Jupyter), PySpark and more.
- Jinja - Jinja template language support for Visual Studio Code.
- Django - Beautiful syntax and scoped snippets for perfectionists with deadlines.
- Visual Studio IntelliCode - Provides AI-assisted productivity features for Python developers in Visual Studio Code with insights based on understanding your code combined with machine learning..
- Python Environment Manager - Provides the ability to view and manage all of your Python environments & packages from a single place.
- Python Docstring Generator - Quickly insert Python comment blocks with contextually inferred parameters for classes and methods based on multiple, selectable template patterns.
- Python Indent - Correct python indentation in Visual Studio Code.
- Jupyter - Provides Jupyter notebook support for Python language, used for data science, scientific computing and machine learning.
- Pylance: Fast, feature-rich language support for Python (update: they have added this part in the extension pack since this post was written.)
- Jupyter: Notebook for python
- CodeSnap: Lets you take screenshots of code
- Path Intellisense: Visual Studio Code plugin that autocompletes filenames.
To enable Jupyter style in python vscode (optional)
Enable this option settings
> jupyter: send selection to interactive window
So Idea is that in vscode you can open the jupyter notebook and run like normal notebook, but what is even better that you get to run the python files like jupyter notebook
By turning on the option, you can open the python file, select the like of code and press shift + enter
. This opens another window which is like jupyter notebook.
Install packages
Easy just use pip, it works and it is simple
pip install blah
References
This guy did a video about it in context of data science, but I found his advice quite nice. https://www.youtube.com/watch?v=zulGMYg0v6U