Difference between revisions of "Integrated Development Environments (IDE)"

From Sustainability Methods
Line 1: Line 1:
 
'''Still in Edition Mode'''
 
'''Still in Edition Mode'''
 
+
== Overview ==
 
You have installed Python and its distribution or package manager, now what? The next important question is where are you going to write and run your Python code?  
 
You have installed Python and its distribution or package manager, now what? The next important question is where are you going to write and run your Python code?  
 
== Overview ==
 
  
 
You can basically write Python code in any text editor applications such as Windows Notepad or macOS TextEdit, and then run it in your terminal command line (Windows Powershell or macOS terminal). For example, you can a create a very short python script:
 
You can basically write Python code in any text editor applications such as Windows Notepad or macOS TextEdit, and then run it in your terminal command line (Windows Powershell or macOS terminal). For example, you can a create a very short python script:
 
 
<syntaxhighlight lang="Plain Text" line>
 
<syntaxhighlight lang="Plain Text" line>
 
name = "gustavo"
 
name = "gustavo"
 
print("Hello world! My name is " + name)
 
print("Hello world! My name is " + name)
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
 
You save the text file as “myscript.py” and then run it in the terminal as follows:
 
You save the text file as “myscript.py” and then run it in the terminal as follows:
 
 
<syntaxhighlight lang="Bash" line>
 
<syntaxhighlight lang="Bash" line>
 
(base) user91@mycomputer ~ % python myscript.py
 
(base) user91@mycomputer ~ % python myscript.py
Line 20: Line 15:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
However, in very few exceptions people run python in this way. Normally, what is used is a Integrated Development Environment (IDE). These IDEs are  applications where you can write and run Python code in an easier and more comfortable way. For example, this is the same python code but run in a Jupyter Notebook:
  
However, in very few exceptions people run python in this way. Normally, what is used is a Integrated Development Environment (IDE). These IDE’s are  applications where you can write and run Python code in an easier and more comfortable way. For example, this is the same python code but run in a Jupyter Notebook:
+
[[File:Example of an IDE.png|800px|frame|center|Example of an IDE (Jupyter Lab) looks like. Source: own]]
 
 
[[File:Example of an IDE.png|800px|frameless|center|Example of an IDE (Jupyter Lab) looks like.]]
 
 
 
 
 
The difference between both are noticeable. Coding in an IDE provides several advantages or functionalities. The colour of the text changes depending of the its type. In the above Jupyter Notebook example, you can see that the variable name is in white, the string value is in red, the function print() is in green. This allows to better identify the several components of your code.
 
 
 
Moreover, working in an IDE helps you to better understand and read your code, and track errors. Referring to the latter, tracking and debugging errors is a daily task of any programmer, and an IDE normally highlights where the errors are.
 
 
 
Another advantage of using IDEs is that you can create visualisations directly.
 
 
 
Depending on the IDE, you get different functionalities such as autocompletion, version control, automation tools, etc.
 
 
 
Among the most popular IDE’s are Jupyter Lab (which contains Jupyter Notebooks), Visual Studio Code and PyCharm, however the latter is more dedicated for python web development. It is recommended to first try the IDE that works best for you before purchasing any. The most common and free of cost IDE are Jupyter Lab and Visual Studio Code. Important about these IDE’s is that you don’t need necessarily internet connection to run them or to work with them.
 
  
You can click on them to see their respective entries where you will learn how to install them.  
+
The difference between both are noticeable. Coding in an IDE provides several advantages or functionalities, for example, the text color. In the above Jupyter Notebook example, you can see that the variable name is in white, the string value is in red, the function print() is in green. This allows you to better identify the several components of your code. In this sense,  working in an IDE helps you to better understand and read your code, and track errors.  Depending on the IDE, you get different functionalities such as autocompletion, file management, version control, automation tools, visualization, etc.  
  
The most simplest way to start if you don’t want to deal with extra configurations is to install the Anaconda distribution which contains several IDE’s.  
+
Among the most popular IDE’s are Jupyter Lab (which contains Jupyter Notebooks), Visual Studio, RStudio Code and PyCharm, however the latter is more dedicated for python web development. It is recommended to first try IDEs that are free of cost such as Jupyter Lab and Visual Studio Code, and select the one that works best for you. Important about these IDEs is that you don’t need necessarily internet connection to run them or to work with them.  
  
If you don’t want to use an IDE, you can also use a web application called “Google Colab”, which offers a development environment in the notebooks format. If your computer is not powerful enough for some data analysis tasks, you can use Google Colab and either use for free and pay for extra computational power. However, you need a stable internet connection for this.
+
Anaconda distribution contains several free and paid IDEs that you can try out right awat. If you don’t want to use an IDE for now, you can also use a web application called “Google Colab”, which offers a development environment in the notebooks format. If your computer is not powerful enough for some data science tasks, you can use Google Colab and either use it for free and pay for extra computational power if needed (for example purchasing some GPU's). However, you need a stable internet connection for this. Check this entry to [[Getting started with Google Colab|get started with Google Colab]].  
  
 
== Jupyter Lab ==
 
== Jupyter Lab ==

Revision as of 11:58, 14 August 2024

Still in Edition Mode

Overview

You have installed Python and its distribution or package manager, now what? The next important question is where are you going to write and run your Python code?

You can basically write Python code in any text editor applications such as Windows Notepad or macOS TextEdit, and then run it in your terminal command line (Windows Powershell or macOS terminal). For example, you can a create a very short python script:

name = "gustavo"
print("Hello world! My name is " + name)

You save the text file as “myscript.py” and then run it in the terminal as follows:

(base) user91@mycomputer ~ % python myscript.py
Hello world! My name is Gustavo

However, in very few exceptions people run python in this way. Normally, what is used is a Integrated Development Environment (IDE). These IDEs are applications where you can write and run Python code in an easier and more comfortable way. For example, this is the same python code but run in a Jupyter Notebook:

Example of an IDE (Jupyter Lab) looks like. Source: own

The difference between both are noticeable. Coding in an IDE provides several advantages or functionalities, for example, the text color. In the above Jupyter Notebook example, you can see that the variable name is in white, the string value is in red, the function print() is in green. This allows you to better identify the several components of your code. In this sense, working in an IDE helps you to better understand and read your code, and track errors. Depending on the IDE, you get different functionalities such as autocompletion, file management, version control, automation tools, visualization, etc.

Among the most popular IDE’s are Jupyter Lab (which contains Jupyter Notebooks), Visual Studio, RStudio Code and PyCharm, however the latter is more dedicated for python web development. It is recommended to first try IDEs that are free of cost such as Jupyter Lab and Visual Studio Code, and select the one that works best for you. Important about these IDEs is that you don’t need necessarily internet connection to run them or to work with them.

Anaconda distribution contains several free and paid IDEs that you can try out right awat. If you don’t want to use an IDE for now, you can also use a web application called “Google Colab”, which offers a development environment in the notebooks format. If your computer is not powerful enough for some data science tasks, you can use Google Colab and either use it for free and pay for extra computational power if needed (for example purchasing some GPU's). However, you need a stable internet connection for this. Check this entry to get started with Google Colab.

Jupyter Lab

Jupyter Lab is a

Visual Studio Code

Visual Studio Code

Other IDEs

Pycharm is a