IPython is an
enhanced interactive Python interpreter, offering
tab completion, object introspection, and much more. It's running on the right-hand side of this page, so you can try it out right now.
Here's a quick micro-tutorial to get you started with some of the fun stuff it provides:
imp then tab to get
import then type
nu and tab
to see which modules you can import that start with
- Import numpy and type
numpy? to get the full
documentation for the
exits the documentation view.
%time numpy.random.rand(1000, 1000).max()
how long it takes to calculate the maximum of a million numbers.
a = 15 and return. Note down the line number (it's in the square brackets in front of the line).
- Now type
%save set_a.py line number to save that line to a file.
To find out more about the save magic function, you can
- Change the value of a:
a = 37
%run set_a.py to get the old value of a back. Just typing
a at the prompt will display its value.
%edit set_a.py will open vi to edit the file. If you're a vi user, you can edit to your heart's content. Otherwise, just type
:q to exit and return to IPython.
That's it for our quick tour. To find out more about IPython, visit the
or read the full tutorial.
This page is powered by PythonAnywhere, an online Python development and hosting environment. Click here to find out more.