In this tutorial, I will show how to install visual studio code on mac. Visual Studio Code is free and available on your favorite platform – Linux, Mac OSX, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.
Four easy steps can do the job for you.
After installing the VS Code, we can also configure the code to open from a command line, and it is pretty darn easy for us to do that.
Now, if you have created any project that goes into that folder and hit the following command to open that project into the Visual Studio Code.
The features that Visual Studio Code includes out-of-the-box are just the start. VS Code extensions let you add languages, debuggers, and tools to your installation to support your development workflow.
By default, VS Code works just like a simple text editor and has no built-in support for python. What We mean by the previous statement is even though you can write python code in VS Code now, you won’t be able to leverage some of the developer tools or techniques that make writing code a lot easier. For example, let us start creating a python file with the name “main.py”, import the JSON module and print the statement “Hello World”. As you write the code, you can see that there is no auto-complete or no IntelliSense provided by the code editor and you need to write the entire statement on your own.
To avoid that, we need to install the Python extension for Visual Studio Code by navigating to https://marketplace.visualstudio.com/items?itemName=ms-python.python and download the extension:
Alternatively, you can also hit the Extensions icon in the left-hand pane inside Visual Studio Code and search for the keyword “python”. Select the extension which is provided by Microsoft and click on Install. I have already installed the extension on my machine:
As soon as the Python extension has been installed, you can see that a “Run” button on the extreme right-hand top appears using which you can run the python file directly within the integrated terminal in VS Code. Also, another thing that you can notice here is that you get several options as to how would you like to run the open python file:
Another point that you might notice after installing this extension is that it provides us with some sort of handy documentation when we hover the cursor over a specific object. For example, in the same file, if we hover over the keyword “Path”, you can now see that a small tooltip is visible, which contains information about the Path module.
Path IntelliSense allows you can easily get the autocomplete keywords from a drop-down. For example, if you now start typing “import”, the editor will automatically start suggesting keywords that match the word as you are typing. This helps to achieve a faster speed in writing code as you need not manually type the entire words to make the script work:
In this lecture, we have explained how to download and install Visual Studio Code on your local machine and how to install an extension inside VS Code. We have also explained how to set up the Visual Studio Code for Python programming by installing the necessary extensions, which offers the developers with much more flexibility and helps in writing code faster in a more productive way.
In the next section, we will start to initialize our project. See you there!