IPython is an enhanced Python REPL, and it’s actually the core for Jupyter notebook. In short, Jupyter is an open-source web application that allows you to create and share documents containing live code, equations, visualizations, and narrative text. If you use the interactive shell a lot and you don’t know IPython, you should really check this one out!
IPython featuresSome of the features the IPython shell offers are:
These are just a selection of the magic commands that are built into IPython that I think you’ll like:
%cd
— change the current working directory%edit
— open an editor and execute the code you typed in after closing the editor%env
— show the current environment variables%pip install [pkgs]
— install packages without leaving the interactive shell%time
and %timeit
— time the execution of Python codeRead the full list in the documentation here.
Referencing previous input and outputAnother useful feature is referencing the input and output of a previous command. In and Out are actual objects. You can use the output of the 3rd command by using Out[3]
. You can re-execute the third command with In[3].
You probably know the drill, but just to be complete, here’s how you install IPython with pip install:
$ pip install ipython
Although it’s often better to use a virtual environment, in this case you may want to install it system-wide or for your entire user account with pip install --user
.
Learn Python properly through small, easy-to-digest lessons, progress tracking, quizzes to test your knowledge, and practice sessions. Each course will earn you a downloadable course certificate.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4