First, what is the FDI and why do we need it? An integrated development environment is an application that makes it possible to write, test, debug and so on.
The choice of the IDE is always left to the discretion of the programmers. The modern IDE is designed as a lightweight, cross-platform application that supports multiple programming languages. With the arrival of AI and its integration into the IDE, developers have the advantage of being more productive. For example, an AI-based code completion function or code generation in the IDE.
Also read it: 27 best IDEs for Linux programming or source code editors
The IDE can also be integrated with source code management systems such as Git, GitHub, and others. Each IDE has its pros and cons, some are too slow if we tend to open a large code base, or some don’t have the necessary packages, etc.
Below are some of the most popular IDEs for Python available on the market.
- Visual Studio Code
- A beautiful text
- Notebook +
Why use the code from Visual Studio?
First of all, I would say that Vscode is my favorite and very popular with developers. According to the Stack overflow 2019 study, vscode is the most popular development tool among programmers.
Vscode is an open source application (under MIT license) developed by Microsoft. GitHub integration, YAML or JSON language support, Cloud d’Azur integration, Docker and Kubernetes support, Ansible support, etc. – Here are some of the features of the vscode and many more
Microsoft has recently integrated Jupyter Notebook with Vscode. The Jupyter notebook is a popular web editor mainly used for data science.
This article describes how to install and configure Visual Studio code on Linux for the Python development environment.
Installing Visual Studio code on Linux
You can install the Visual Studio code from the software center that comes with each Linux distribution. You can also use the following instructions to install VSCode in your Linux distribution
Installing the VSCode in Debian and Ubuntu
The easiest way to install Visual Studio code on Debian and Ubuntu distributions is to use the command line as shown in the figure.
$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg –dearmor > packages.microsoft.gpg$ sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/$ sudo sh -c ‘echo deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main > /etc/apt/sources.list.d/vscode.list’s $ sudo apt-get install apt-transport-https$ sudo apt-get update$ sudo apt-get install code$ sudo apt-get
VSCode installation in CentOS/RHEL and Fedora
The easiest way to install the Visual Studio code on CentOS, RHEL and Fedora is to use the following script, which installs the key and the repository
sudo rpm –import https://packages.microsoft.com/keys/microsoft.asc
$ sudo sh -c ‘echo -e [code] name=Visual Studio Codenbaseurl=https://packages.microsoft.com/yumrepos/vscodenenabled=1ngpgcheck=1ngpgkey=https://packages.microsoft.com/keys/microsoft.asc > /etc/yum.repos.d/vcode.repo’
$ sudo dnf check update
$ sudo dnf install code
$ sudo yum check update
$ sudo yum installation code
If you need more information on how to install on your specific version of Linux, please refer to the official Microsoft documents.
How to use Visual Studio code on Linux
The first thing you need to decide when you open the Vscode for the first time is to enable/disable the homepage at startup.
Turn off the VSCode homepage
Code short description
Keyboard shortcuts are edited in Vscode, which means we can adjust our keystrokes. Press CTRL + k CTRL + S to open the keypad display settings. You can also open it in JSON format.
Keyboard shortcut VSCode
Standard keyboard display
- THE ORDER PALLET: CTRL + OFFSET + P
- THE COMMAND LINE: CTRL + ~
- A LEFT-WING INTENTION: [ CTRL + ]
- THE GOOD INTENTION: CTRL + [
- REMARKS: CTRL + / /
- DEBUG CONSOLE : CTRL + SCISSORS + Y
- EXPORTER : CTRL + SCISSORS + E
- SHOW ME THE SIDEBAR: CTRL + B
- FULL SCREEN MODE : F11
- SEN MODE : CTRL + K Z
- COMMENTARY ON THE BOOK: CTRL + SCISSORS + A
Now that we have seen some important details of VSCODE, it is time to configure Vscode for development under Python. The real strength of any word processor lies in the packages. Vscode has made package management very easy.
To install a package, open the ATTENTION tab on the left side of the action bar. Simply enter a package name in the search field and click the Install button.
Set the Python extension to VSCode
First of all, we need a Python extension to execute the Python code in Vscode.
Installing the Python extension in VSCode
After installing the package, you can select the installed Python interpreter. If you have set up multiple interpreters (e.g. 3.5, 3.8), it is very easy to switch from one interpreter to another. In the bottom left corner you have the possibility to select a translator.
Select a Python translator
Specification of subjects in VSC Code
The topics are always a personal choice of the developers. I chose the standard Vscode theme because I really like it. You can choose the one that attracts you. To set the subject [WARNING -> Search bar -> -> SETTINGS].
VSCode Standard Theme
You can find information about themes or other packages on the Vscode market.
Setting file symbols in VSCode
I personally use the MATERIAL THEME icon for file icons. To set them [WARNING -> Search bar -> HARDWARE theme icon -> Settings]. Select your preferred file theme.
Defining the symbol theme in VSCode
Setting SSH to VSCode
Remote SSH allows you to open folders remotely via an SSH server. Often people develop applications in the cloud and use Vscode on our local machine. We can use remote SSH to upload/synchronize our code to a remote machine, a virtual machine or a container.
To install the package [WARNING -> Search bar -> REMOVE – SSH -> SETTINGS]. Look at the package provided by Microsoft.
Installing a remote SSH in VSCode
To configure the settings of the remote server, open [CONTROL PANEL (SHIFT + CTRL + P) -> NEW HOST CONFIGURATION -> DEVELOP NEW HOST CONFIGURATION (OR) CHOOSE HOST CONFIGURATION]. Once the installation is complete, you will be prompted for a password when you connect to the remote computer.
Connecting to the SSH host
I have already set up 3 Linux hosts in vscode. So when I connect to a host, he just asks me for a password and makes the connection.
VSCode SSH Configuration
VSCode Add a new SSH host
You can also refer to the official documentation for setting up SSH remotely in VSCode.
Installation of the suspension in VSCode
Linters points out our problems with syntax and style. When we install the Python extension package for the first time, it comes standard with PYLINT enabled. The linter starts when we save the file, or we can start it manually using the command field.
To use different pads, we must first define the padding with the following PIP command and then select flake8 as padding in vscode with [ PALLET COMMAND -> SELECT LINTER].
# Flakes installed in pipelines8
Activate or deactivate the garter [CONTROL PANEL -> ACTIVATE].
Switching LINTER on or off in VSCode
If you have multiple versions of Python, make sure the liner is installed on all versions. Now the Flake8 I installed is linked to Python 3.8, if I upgrade to Python 3.5 and try to use Flake 8, it will not work.
NOTE : The Lynxes are connected to the current workspace, not to the global space.
Now, flake8 will start ejecting errors for each syntax or logical error. In the fragment below, I broke the writing style of the Python code in PEP 8, so Flocke 8 gives me warnings and errors.
VSCode ribbon error
There are many kinds of display cases. For more information about the Vscode Linters, see the official documentation.
Set the card button to VSCode
If you are a developer who switches to Vscode from another text editor, you can choose to save keyboard shortcuts with the keyboard package. Microsoft supplies the keyboards of some well-known editors such as Sublime, Atom, Visual Studio etc.
Visual Studio keyboard layout
Installation of other packages in VSCode
Since Vscode is part of Microsoft, it is very easy to integrate tools created by Microsoft. You can select and install packages according to your needs. In addition to the packages I have shown you above, I use Azure Resource Manager, Azure Functions, and so on.
- Vscode offers a variety of azure blue extensions for working with the azure cloud.
- GitHub can be easily integrated with Vscode in just a few steps.
- Packaging for container solutions such as dockers, cubernetes.
- Package for the SQL server.
For more information about all packages, please visit Microsoft’s official marketplace.
NOTE : The package I have installed in this article is my personal choice. The list of packages may vary depending on the type of development and requirements.
One of the innovations of Vscode is the possibility to integrate a Jupyter laptop. The Jupyter notebook is a very popular web editor, which is mainly used for data science. Just install the Jupyter laptop on the local machine, and Vscode can select the Jupyter server and run the kernel.
To install a Jupiter laptop:
# Pipeline to install Jupiter
How to run a fragment in VSCode
Now that we’ve set up our editor, it’s time to run the Python code. An interesting feature of vscode that I like is that it can execute the boot that is selected in the Python console.
To start the Python code, press the [RUN] icon in the upper right corner of the editor or right-click and select Startup Options.
Running Python fragments in VSCode
If you select Execute Selection/Line in the Python terminal, Vscode will only execute this part in the terminal. It is in some cases very useful if you only need to test a few selected lines of code.
Execute the selected line in VSCode
In this article we have seen how to install and configure Vscode as our Python programming editor. Vscode is one of the most popular publishers on the market today. If you are new to Vscode, feel free to find out more about Vscode by consulting the official documentation.visual studio code python virtualenv,python extension for visual studio code,visual studio code python download,visual studio python,visual studio 2017 python tutorial,how to run code in visual studio code,visual studio code interactive python,visual studio code opencv-python