DataScience Workbook / 04. Development Environment / 2. Python programming environment(s)
Python ⤴ is a high-level, interpreted programming language that is widely used for scientific computing, data analysis, artificial intelligence algorithms implementation, web development, and visualization. It has a simple and easy-to-learn syntax, a large standard library, and a wide community making it a popular choice for beginners and experienced programmers alike.
In computer science, an interpreted language is a type of programming language for which most of its implementations execute instructions directly, without previously compiling a program into machine-language instructions. This makes it easier to write and test code, however, Python programs may run slower than those written in a compiled language.
To learn more about Python programming and its advantages, see section 05. Introduction to Programming / Introduction to Python programming ⤴
Python programming environment
There are several ways to set up a Python programming environment, depending on your needs and preferences. In the following subsections you can explore a few common options.
1. Online coding platforms (beginner)
There are also online platforms that allow you to write and run Python code directly in your web browser, without the need to install anything on your local computer. Some examples include:
- Python Shell ⤴, includes an online console from PythonAnywhere; use it right away without creating an account or signing-in
- CodeAcademy ⤴, includes a code editor and interactive exercises to help you learn programming; offers interactive courses and tutorials on a variety of programming languages, including Python
- Repl.it ⤴, includes a code editor, debugger, and integrations with various tools and services; supports a wide range of programming languages, including Python
- Trinket ⤴, includes a code editor, debugger, and integrations with various tools and services; supports a number of programming languages, including Python
- PythonAnywhere ⤴, includes a code editor, debugger, and support for web development frameworks such as Django and Flask; supports developing and hosting Python web applications
Typically, these online platform provide interface for the Python built-in shell, i.e., the Integrated Development and Learning Environment (Python IDLE) that comes with the standard installation of Python.
2. Command Line (CL) code editors (intermediate)
You can also use a plain text editor, such as nano ⤴ [GNU], Vim ⤴ [Bram Moolenaar], or mcedit ⤴ [Midnight Commander] to write Python code and run it from the command line. To do this, you will need to install Python on your computer and then use the Python interpreter to execute your code.
This option is a good choice to develop quickly a simple script directly on the remote machine (such as high-performance computing cluster) where the graphical user interface (GUI) is not available.
Learn more !
…about the CL editors from the tutorial Text Files Editors ⤴ in this workbook ⤴
3. Integrated Development Environment (IDE) (advanced)
An Integrated Development Environment (IDE) is a software application that provides a comprehensive set of tools for software development. IDEs typically provide a range of tools and features for editing, debugging, and testing code, as well as integrations with other tools and services that are commonly used in software development (e.g., Git version control).
A. Multi-language IDE
There are many multi-language IDEs available, such as VSC ⤴ [Microsoft], Eclipse ⤴, NetBeans ⤴, and IntelliJ IDEA ⤴ [JetBrains].
Multi-language IDEs can be useful for developers who work on projects that involve more than one programming language, as they provide a single platform for managing all of the code and related resources. They can also be a good choice for developers who want a more comprehensive development environment that includes a range of tools and features beyond just a code editor.
Learn more !
…about the VSC IDE from the Tutorial: Visual Studio Code ⤴ in this workbook ⤴
B. Python-dedicated IDE
Some popular IDEs dedicated for programming in Python include IDLE ⤴ (included with the Python installation), PyCharm ⤴, and Spyder ⤴.
Using a Python-dedicated IDE can make it easier to work with Python code and take advantage of the language's features. These IDEs often include advanced code completion and error highlighting, as well as a range of debugging and testing tools. They may also include integrations with popular third-party libraries and frameworks, such as Django and Flask. Overall, using a Python-dedicated IDE can be a good choice if you are primarily working with Python and want a development environment that is optimized for the language.
Learn more !
…about the PyCharm IDE from the tutorial PyCharm: IDE for Professional Python Developers ⤴ in this workbook ⤴
C. Web-based interactive DE
JupyterLab ⤴ is an open-source web-based interactive development environment (IDE) for working with Jupyter notebooks, code, and data. It is not a traditional IDE in the sense that it does not provide features such as a code editor or debugger, but it does offer a range of tools and features for working with notebooks and other interactive documents that combine code, text (markdown), and visualizations.
|1. Launch Jupyter Lab||2. Develop code, comment, and visualize results|
Although, JupyterLab does not include a debugger in the traditional sense, it supports the use of third-party debugging tools, such as the Python debugger (pdb ⤴) and the IPython debugger (ipdb ⤴). These tools allow you to set breakpoints and step through your code line by line, examining variables and other runtime information as you go.
Overall, JupyterLab is a useful tool for interactive computing and data analysis, particularly in the fields of scientific computing, data science, and machine learning. However, it is not a traditional IDE and may not be the best choice for all types of development projects.
Learn more !
…about the Jupyter Lab from the tutorial Jupyter: Interactive Web-Based Multi-Kernel Programming Interface ⤴ in this workbook ⤴
2.1 Online Console: simple Python code in a browser (without installation)
2.2 Online Notebook: interactive Python code on Try-jupyter and Colab (without installation)
- 2.3 Python Setup on your computing machine (installation needed)
- 3. R programming environment(s)