@@ -8,12 +8,27 @@ You don't need to know anything beyond Python to start using IPython – just ty
88commands as you would at the standard Python prompt. But IPython can do much
99more than the standard prompt. Some key features are described here. For more
1010information, check the :ref: `tips page <tips >`, or look at examples in the
11- `IPython cookbook <http ://wiki. ipython.org/index.php?title= Cookbook >`_.
11+ `IPython cookbook <https ://github.com/ ipython/ipython/wiki/ Cookbook%3A-Index >`_.
1212
1313If you've never used Python before, you might want to look at `the official
1414tutorial <http://docs.python.org/tutorial/> `_ or an alternative, `Dive into
1515Python <http://diveintopython.org/toc/index.html> `_.
1616
17+ The four most helpful commands
18+ ===============================
19+
20+ The four most helpful commands, as well as their brief description, is shown
21+ to you in a banner, every time you start IPython:
22+
23+ ========== =========================================================
24+ command description
25+ ========== =========================================================
26+ ? Introduction and overview of IPython's features.
27+ %quickref Quick reference.
28+ help Python's own help system.
29+ object? Details about 'object', use 'object??' for extra details.
30+ ========== =========================================================
31+
1732Tab completion
1833==============
1934
@@ -31,16 +46,19 @@ including docstrings, function definition lines (for call arguments) and
3146constructor details for classes. To get specific information on an object, you
3247can use the magic commands ``%pdoc ``, ``%pdef ``, ``%psource `` and ``%pfile ``
3348
49+ .. _magics_explained :
50+
3451Magic functions
3552===============
3653
3754IPython has a set of predefined 'magic functions' that you can call with a
3855command line style syntax. There are two kinds of magics, line-oriented and
39- cell-oriented. Line magics are prefixed with the ``% `` character and work much
56+ cell-oriented. ** Line magics ** are prefixed with the ``% `` character and work much
4057like OS command-line calls: they get as an argument the rest of the line, where
41- arguments are passed without parentheses or quotes. Cell magics are prefixed
42- with a double ``%% ``, and they are functions that get as an argument not only
43- the rest of the line, but also the lines below it in a separate argument.
58+ arguments are passed without parentheses or quotes. **Cell magics ** are
59+ prefixed with a double ``%% ``, and they are functions that get as an argument
60+ not only the rest of the line, but also the lines below it in a separate
61+ argument.
4462
4563The following examples show how to call the builtin ``timeit `` magic, both in
4664line and cell mode::
@@ -58,34 +76,41 @@ The builtin magics include:
5876- Functions that work with code: ``%run ``, ``%edit ``, ``%save ``, ``%macro ``,
5977 ``%recall ``, etc.
6078- Functions which affect the shell: ``%colors ``, ``%xmode ``, ``%autoindent ``,
61- etc.
62- - Other functions such as ``%reset ``, ``%timeit `` or ``%paste ``.
79+ ``%automagic ``, etc.
80+ - Other functions such as ``%reset ``, ``%timeit ``, ``%%file ``, ``%load ``, or
81+ ``%paste ``.
6382
64- You can always call them using the % prefix, and if you're calling a line magic
65- on a line by itself, you can omit even that (cell magics must always have the
66- ``%% `` prefix)::
83+ You can always call them using the ``% `` prefix, and if you're calling a line
84+ magic on a line by itself, you can omit even that::
6785
6886 run thescript.py
6987
88+ You can toggle this behavior by running the ``%automagic `` magic. Cell magics
89+ must always have the ``%% `` prefix.
90+
7091A more detailed explanation of the magic system can be obtained by calling
7192``%magic ``, and for more details on any magic function, call ``%somemagic? `` to
7293read its docstring. To see all the available magic functions, call
7394``%lsmagic ``.
7495
96+ .. seealso ::
97+
98+ `Cell magics `_ example notebook
99+
75100Running and Editing
76101-------------------
77102
78- The %run magic command allows you to run any python script and load all of its
79- data directly into the interactive namespace. Since the file is re-read from
80- disk each time, changes you make to it are reflected immediately (unlike
81- imported modules, which have to be specifically reloaded). IPython also includes
82- :ref: `dreload <dreload >`, a recursive reload function.
103+ The `` %run `` magic command allows you to run any python script and load all of
104+ its data directly into the interactive namespace. Since the file is re-read
105+ from disk each time, changes you make to it are reflected immediately (unlike
106+ imported modules, which have to be specifically reloaded). IPython also
107+ includes :ref: `dreload <dreload >`, a recursive reload function.
83108
84- %run has special flags for timing the execution of your scripts (-t), or for
85- running them under the control of either Python's pdb debugger (-d) or
109+ `` %run `` has special flags for timing the execution of your scripts (-t), or
110+ for running them under the control of either Python's pdb debugger (-d) or
86111profiler (-p).
87112
88- The %edit command gives a reasonable approximation of multiline editing,
113+ The `` %edit `` command gives a reasonable approximation of multiline editing,
89114by invoking your favorite editor on the spot. IPython will execute the
90115code you type in there as if it were typed interactively.
91116
@@ -153,11 +178,12 @@ visited directories and allows you to go to any previously visited one.
153178Configuration
154179=============
155180
156- Much of IPython can be tweaked through configuration. To get started, use the
157- command ``ipython profile create `` to produce the default config files. These
158- will be placed in :file: `~/.ipython/profile_default ` or
159- :file: `~/.config/ipython/profile_default `, and contain comments explaining what
160- the various options do.
181+ Much of IPython can be tweaked through :ref: `configuration <config_overview >`.
182+ To get started, use the command ``ipython profile create `` to produce the
183+ default config files. These will be placed in
184+ :file: `~/.ipython/profile_default ` or
185+ :file: `~/.config/ipython/profile_default `, and contain comments explaining
186+ what the various options do.
161187
162188Profiles allow you to use IPython for different tasks, keeping separate config
163189files and history for each one. More details in :ref: `the profiles section
@@ -173,7 +199,4 @@ as the IPython shell is constructed, before any other code or scripts you have
173199specified. The files will be run in order of their names, so you can control the
174200ordering with prefixes, like ``10-myimports.py ``.
175201
176- .. note ::
177-
178- Automatic startup files are new in IPython 0.12. Use InteractiveShellApp.exec_files
179- in :file: `ipython_config.py ` for similar behavior in 0.11.
202+ .. include :: ../links.txt
0 commit comments