##// END OF EJS Templates
Magics
David P. Sanders -
Show More
@@ -153,10 +153,10 b' Cell types'
153 Each IPython input cell has a *cell type*.
153 Each IPython input cell has a *cell type*.
154 There is a restricted number of possible cell types, which may be set by using the cell type dropdown on the toolbar, or via the following keyboard shortcuts:
154 There is a restricted number of possible cell types, which may be set by using the cell type dropdown on the toolbar, or via the following keyboard shortcuts:
155
155
156 * code :kbd:`Ctrl-m y`
156 * **code**: :kbd:`Ctrl-m y`
157 * markdown :kbd:`Ctrl-m m`
157 * **markdown**: :kbd:`Ctrl-m m`
158 * raw :kbd:`Ctrl-m t`
158 * **raw**: :kbd:`Ctrl-m t`
159 * heading :kbd:`Ctrl-m 1` - :kbd:`Ctrl-m 6`
159 * **heading**: :kbd:`Ctrl-m 1` - :kbd:`Ctrl-m 6`
160
160
161
161
162 Code cells
162 Code cells
@@ -181,22 +181,34 b' Raw cells provide a place to put additional information which is not evaluated b'
181
181
182 Magic commands
182 Magic commands
183 --------------
183 --------------
184 Magic commands, or *magics*, are one-word commands starting with `%%`, which give commands to IPython itself (as opposed to standard Python commands which are exported to be run in a Python interpreter).
184 Magic commands, or *magics*, are one-word commands beginning with the symbol ``%``, which send commands to IPython itself (as opposed to standard Python commands which are exported to be run in a Python interpreter).
185
185
186 Magics control different elements of the way that the IPython notebook operates. They are entered into standard code cells and executed as usual with :kbd:`Shift-Enter`.
186 Magics control different elements of the way that the IPython notebook operates. They are entered into standard code cells and executed as usual with :kbd:`Shift-Enter`.
187
187
188 Some of the main magics are the following:
188 There are two types of magics: *line magics*, which begin with a single ``%`` and operate on a single line of the code cell; and *cell magics*, which begin with ``%%`` and operate on the entire contents of the cell.
189
189
190 * ``%lsmagic``
190 Line magics
191 Lists all the magic commands available
191 ˜˜˜˜˜˜˜˜˜˜˜
192
192
193 * ``%config``
193 Some of the available line magics are the following:
194 Configuration of IPython
195
194
196 * ``%timeit``
195 * ``%load``:
197 Time a single line of code.
196 Loads a file and places its content into a new code cell.
198
197
199 There are also *cell magics*, which start with ``%%``
198 * ``%timeit``:
199 A simple way to time how long a single line of code takes to run
200
201 * ``%config``:
202 Configuration of the IPython Notebook
203
204 * ``%lsmagic``:
205 Provides a list of all available magic commands
206
207 Cell magics
208 ˜˜˜˜˜˜˜˜˜˜˜
209
210 * ``%load``:
211
200
212
201
213
202 Plotting
214 Plotting
General Comments 0
You need to be logged in to leave comments. Login now