rich@rich-ubuntu:~/working/fb_recruit/working$ ipython
Python 2.7.6 |Anaconda 1.8.0 (64-bit)| (default, Nov 11 2013, 10:47:18)
Type "copyright", "credits" or "license" for more information.
IPython 1.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: arange(4)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2e43d7eb1b3e> in <module>()
----> 1 arange(4)
NameError: name 'arange' is not defined
In [2]: %pylab
Using matplotlib backend: Qt4Agg
Populating the interactive namespace from numpy and matplotlib
In [3]: arange(4)
Out[3]: array([0, 1, 2, 3])
In [4]:
to run a script in ipython using an empty namespace, type space then a script name:
%run
to execute a code snippet (particularly for multi-line snippets which would usually cause an _IndentationError_ to be thrown):
%paste
When the %pylab magic function is entered at the IPython prompt, it triggers
the import of various modules within Matplotlib.
Which modules? well, the ones subsumed under the pylab interface.
The awesome Matplotlib plotting library has two distinct interfaces: a pythonic one, and the original MATLAB-like one intended for plotting at the interactive prompt.