r/IPython • u/avamk • Feb 28 '15
What exactly is IPython?
Hello,
I am relatively new to learning Python, and am confused by exactly what IPython is. Is it an implementation of Python like CPython, Jython, PyPy et al.? Or is it more like an IDE like Eric or Spyder? Or is it an IDE that is integrated with its own implementation of Python? Would the Notebook be part of that IDE? Is there an ELI5 explanation for how to conceptualise IPython?
Thanks!!
15
Upvotes
8
u/hharison Mar 01 '15 edited Mar 01 '15
IPython is a system for interactively running Python code. It runs a Python kernel in the background and provides several frontends. The console is like the regular Python console in a terminal with some extra features. The IPython QTConsole is similar but in a QT-based graphical frontend which allows for things like copying and pasting that are difficult in a regular terminal. The QTConsole can also display plots.
The flagship product is the IPython Notebook. This lets you intersperse code, text, and plots.
It's not an IDE; it doesn't do any project-management stuff and it's not really intended for making code that you'll distribute in any other format but the notebook. It's mostly used in a scientific context, for example to demonstrate a data analysis technique. You can describe the technique in regular paragraph form, and include the code at the same time, along with the results.
For example: http://nbviewer.ipython.org/github/adrn/ipython/blob/2.x/examples/Notebook/Trapezoid%20Rule.ipynb
Some IDEs, like Spyder and PyCharm, can run the IPython console or qtconsole as the terminal section of the GUI. Think of IPython like that: it's just the part of the IDE (or a development environment of multiple programs) for interactively running code, testing stuff out, etc.
2
u/isforinsects Mar 01 '15
Well, consider ipython and ipython notebook a bit separate first. Ipython is an interactive python shell with extra features beyond the standard python interactive shell. Colors, history, and getting the docstring of a function by typing
function?are examples of ipython's improvements.Ipython isn't a production environment for running standard non-interactive python (generally, there are exceptions to this rule).
2
u/[deleted] Mar 01 '15
Have you ever just typed "python" at a terminal prompt and then messed around with simple Python statements? That's the Python interactive shell. IPython is just like Python, but with more goodies in the interactive shell. There are lots of videos available to give you an impression of what this is like.
By contrast, IPython notebook is web-based version of Python that allows you to create online notebooks that mix markdown formatted text, LaTeX, Python code snippets, plots, images, and much more. Again, an online video is probably the best way to get an idea of what it is like. The confusing bit about IPython notebook is that it is not a web site, per se, but a dedicated little web server that you can run on your own computer with the user interface being your regular web browser.
After you watch the videos you should try the online demo of the latest IPython notebook.