DataScience Workbook / 04: Development Environment / 2. Python programming environment(s)

Introduction

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.

Python

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.

…about Python programming and its advantages in section:
/

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.

03_python-online-console.png

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.

Python

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.

…about the CLI text editors from the tutorial 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).

Python

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.

…about the VSC IDE from the tutorial Visual Studio Code

B. Python-dedicated IDE

Some popular IDEs dedicated for programming in Python include IDLE ⤴ (included with the Python installation), PyCharm ⤴, and Spyder ⤴.

Python

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.

…about the PyCharm IDE from the tutorial 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
Merge data app Merge data app

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.

…about the Jupyter Lab from the tutorial in this workbook.