Show Sidebar Hide Sidebar

IPython vs Python in Python

Discussion of key differences between IPython and Python

What is the difference between IPython and Python?

While these two names are quite similar, they refer to entirely different things.

Python is a general-purpose programming language. It was created in the late 1980s by Guido van Rossum. It is now one of the most popular languages in the world. It is routinely used by system administrators and web developers. Also, many scientists are using Python thanks to libraries such as NumPy, SciPy, pandas, and matplotlib. The ease of use of Python and its dynamic nature make it a very productive language.

IPython is an interactive command-line terminal for Python. It was created by Fernando Perez in 2001. IPython offers an enhanced read-eval-print loop (REPL) environment particularly well adapted to scientific computing.

IPython terminal

In other words, IPython is a powerful interface to the Python language. But it is certainly not the only one. Besides IPython, the most common way to use Python is to write scripts, files with the .py extension.

A script contains a list of commands to execute in order. It runs from start to finish and display some output. On the contrary, with IPython, you generally write one command at a time and you get the results instantly. This is a completely different way of working with Python. When analyzing data or running computational models, you need this sort of interactivity to explore them efficiently.

Jupyter Notebook

In 2011, IPython introduced a new tool named the Notebook. Inspired by scientific programs like Mathematica or Sage, the Notebook offers a modern and powerful web interface to Python.

IPython Notebook

Compared to the original IPython terminal, the Notebook offers a more convenient text editor, the possibility to write rich text, and improved graphical capabilities. Also, since it is a web interface, it can integrate many of the existing web libraries for data visualization, including plotly.js.

In 2015, the IPython developers made a major code reorganization of their ever-growing project. The Notebook is now called the Jupyter Notebook. This interface can be used not only with Python but with dozens of other languages such as R and Julia. IPython is now the name of the Python backend (aka kernel).

In conclusion, IPython and Jupyter are great interfaces to the Python language. If you're learning Python, using the IPython terminal or the Jupyter Notebook is highly recommended.

This was a guest article written by Cyrille Rossant, author of Learning IPython for Interactive Computing and Data Visualization, second edition and IPython Interactive Computing and Visualization Cookbook.

Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to a Developer Support Plan.