##// END OF EJS Templates
Make interactive_usage a bit more rst friendly...
Carlos Cordoba -
Show More
@@ -74,6 +74,7 b" At your system command line, type 'ipython -h' to see the command line"
74 74 options available. This document only describes interactive features.
75 75
76 76 MAIN FEATURES
77 -------------
77 78
78 79 * Access to the standard Python help. As of Python 2.1, a help system is
79 80 available with access to object docstrings and the Python manuals. Simply
@@ -116,13 +117,13 b' MAIN FEATURES'
116 117 * Search previous command history in two ways (also requires readline):
117 118
118 119 - Start typing, and then use Ctrl-p (previous,up) and Ctrl-n (next,down) to
119 search through only the history items that match what you've typed so
120 far. If you use Ctrl-p/Ctrl-n at a blank prompt, they just behave like
121 normal arrow keys.
120 search through only the history items that match what you've typed so
121 far. If you use Ctrl-p/Ctrl-n at a blank prompt, they just behave like
122 normal arrow keys.
122 123
123 124 - Hit Ctrl-r: opens a search prompt. Begin typing and the system searches
124 your history for lines that match what you've typed so far, completing as
125 much as it can.
125 your history for lines that match what you've typed so far, completing as
126 much as it can.
126 127
127 128 - %hist: search history by index (this does *not* require readline).
128 129
@@ -189,52 +190,68 b' MAIN FEATURES'
189 190
190 191 * Auto-parentheses and auto-quotes (adapted from Nathan Gray's LazyPython)
191 192
192 1. Auto-parentheses
193 Callable objects (i.e. functions, methods, etc) can be invoked like
194 this (notice the commas between the arguments):
195 In [1]: callable_ob arg1, arg2, arg3
196 and the input will be translated to this:
197 ------> callable_ob(arg1, arg2, arg3)
198 This feature is off by default (in rare cases it can produce
199 undesirable side-effects), but you can activate it at the command-line
200 by starting IPython with `--autocall 1`, set it permanently in your
201 configuration file, or turn on at runtime with `%autocall 1`.
202
203 You can force auto-parentheses by using '/' as the first character
204 of a line. For example:
205 In [1]: /globals # becomes 'globals()'
206 Note that the '/' MUST be the first character on the line! This
207 won't work:
208 In [2]: print /globals # syntax error
209
210 In most cases the automatic algorithm should work, so you should
211 rarely need to explicitly invoke /. One notable exception is if you
212 are trying to call a function with a list of tuples as arguments (the
213 parenthesis will confuse IPython):
214 In [1]: zip (1,2,3),(4,5,6) # won't work
215 but this will work:
216 In [2]: /zip (1,2,3),(4,5,6)
217 ------> zip ((1,2,3),(4,5,6))
218 Out[2]= [(1, 4), (2, 5), (3, 6)]
219
220 IPython tells you that it has altered your command line by
221 displaying the new command line preceded by -->. e.g.:
222 In [18]: callable list
223 -------> callable (list)
224
225 2. Auto-Quoting
226 You can force auto-quoting of a function's arguments by using ',' as
227 the first character of a line. For example:
228 In [1]: ,my_function /home/me # becomes my_function("/home/me")
229
230 If you use ';' instead, the whole argument is quoted as a single
231 string (while ',' splits on whitespace):
232 In [2]: ,my_function a b c # becomes my_function("a","b","c")
233 In [3]: ;my_function a b c # becomes my_function("a b c")
234
235 Note that the ',' MUST be the first character on the line! This
236 won't work:
237 In [4]: x = ,my_function /home/me # syntax error
193 1. Auto-parentheses
194
195 Callable objects (i.e. functions, methods, etc) can be invoked like
196 this (notice the commas between the arguments)::
197
198 In [1]: callable_ob arg1, arg2, arg3
199
200 and the input will be translated to this::
201
202 callable_ob(arg1, arg2, arg3)
203
204 This feature is off by default (in rare cases it can produce
205 undesirable side-effects), but you can activate it at the command-line
206 by starting IPython with `--autocall 1`, set it permanently in your
207 configuration file, or turn on at runtime with `%autocall 1`.
208
209 You can force auto-parentheses by using '/' as the first character
210 of a line. For example::
211
212 In [1]: /globals # becomes 'globals()'
213
214 Note that the '/' MUST be the first character on the line! This
215 won't work::
216
217 In [2]: print /globals # syntax error
218
219 In most cases the automatic algorithm should work, so you should
220 rarely need to explicitly invoke /. One notable exception is if you
221 are trying to call a function with a list of tuples as arguments (the
222 parenthesis will confuse IPython)::
223
224 In [1]: zip (1,2,3),(4,5,6) # won't work
225
226 but this will work::
227
228 In [2]: /zip (1,2,3),(4,5,6)
229 ------> zip ((1,2,3),(4,5,6))
230 Out[2]= [(1, 4), (2, 5), (3, 6)]
231
232 IPython tells you that it has altered your command line by
233 displaying the new command line preceded by -->. e.g.::
234
235 In [18]: callable list
236 -------> callable (list)
237
238 2. Auto-Quoting
239
240 You can force auto-quoting of a function's arguments by using ',' as
241 the first character of a line. For example::
242
243 In [1]: ,my_function /home/me # becomes my_function("/home/me")
244
245 If you use ';' instead, the whole argument is quoted as a single
246 string (while ',' splits on whitespace)::
247
248 In [2]: ,my_function a b c # becomes my_function("a","b","c")
249 In [3]: ;my_function a b c # becomes my_function("a b c")
250
251 Note that the ',' MUST be the first character on the line! This
252 won't work::
253
254 In [4]: x = ,my_function /home/me # syntax error
238 255 """
239 256
240 257 interactive_usage_min = """\
General Comments 0
You need to be logged in to leave comments. Login now