Show More
@@ -195,6 +195,11 b' MAIN FEATURES' | |||||
195 | In [1]: callable_ob arg1, arg2, arg3 |
|
195 | In [1]: callable_ob arg1, arg2, arg3 | |
196 | and the input will be translated to this: |
|
196 | and the input will be translated to this: | |
197 | ------> callable_ob(arg1, arg2, arg3) |
|
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 | ||||
198 | You can force auto-parentheses by using '/' as the first character |
|
203 | You can force auto-parentheses by using '/' as the first character | |
199 | of a line. For example: |
|
204 | of a line. For example: | |
200 | In [1]: /globals # becomes 'globals()' |
|
205 | In [1]: /globals # becomes 'globals()' | |
@@ -285,7 +290,7 b' _oh : Output history' | |||||
285 |
|
290 | |||
286 | Autocall: |
|
291 | Autocall: | |
287 |
|
292 | |||
288 | f 1,2 : f(1,2) |
|
293 | f 1,2 : f(1,2) # Off by default, enable with %autocall magic. | |
289 | /f 1,2 : f(1,2) (forced autoparen) |
|
294 | /f 1,2 : f(1,2) (forced autoparen) | |
290 | ,f 1 2 : f("1","2") |
|
295 | ,f 1 2 : f("1","2") | |
291 | ;f 1 2 : f("1 2") |
|
296 | ;f 1 2 : f("1 2") |
@@ -44,289 +44,29 b' interface, or specify the gui at the commandline::' | |||||
44 | $ ipython --gui=qt |
|
44 | $ ipython --gui=qt | |
45 |
|
45 | |||
46 |
|
46 | |||
47 | Regular Options |
|
47 | Command-line Options | |
48 | --------------- |
|
48 | -------------------- | |
|
49 | ||||
|
50 | To see the options IPython accepts, use ``ipython --help`` (and you probably | |||
|
51 | should run the output through a pager such as ``ipython --help | less`` for | |||
|
52 | more convenient reading). This shows all the options that have a single-word | |||
|
53 | alias to control them, but IPython lets you configure all of its objects from | |||
|
54 | the command-line by passing the full class name and a corresponding value; type | |||
|
55 | ``ipython --help-all`` to see this full list. For example:: | |||
|
56 | ||||
|
57 | ipython --pylab qt | |||
|
58 | ||||
|
59 | is equivalent to:: | |||
|
60 | ||||
|
61 | ipython --TerminalIPythonApp.pylab='qt' | |||
|
62 | ||||
|
63 | Note that in the second form, you *must* use the equal sign, as the expression | |||
|
64 | is evaluated as an actual Python assignment. While in the above example the | |||
|
65 | short form is more convenient, only the most common options have a short form, | |||
|
66 | while any configurable variable in IPython can be set at the command-line by | |||
|
67 | using the long form. This long form is the same syntax used in the | |||
|
68 | configuration files, if you want to set these options permanently. | |||
49 |
|
69 | |||
50 | After the above threading options have been given, regular options can |
|
|||
51 | follow in any order. All options can be abbreviated to their shortest |
|
|||
52 | non-ambiguous form and are case-sensitive. |
|
|||
53 |
|
||||
54 | Most options can also be set from your configuration file. See the provided |
|
|||
55 | example for more details on what the options do. Options given at the command |
|
|||
56 | line override the values set in the configuration file. |
|
|||
57 |
|
||||
58 | All options with a [no] prepended can be specified in negated form |
|
|||
59 | (--no-option instead of --option) to turn the feature off. |
|
|||
60 |
|
||||
61 | ``-h, --help`` print a help message and exit. |
|
|||
62 |
|
||||
63 | ``--pylab, pylab=<name>`` |
|
|||
64 | See :ref:`Matplotlib support <matplotlib_support>` |
|
|||
65 | for more details. |
|
|||
66 |
|
||||
67 | ``--autocall=<val>`` |
|
|||
68 | Make IPython automatically call any callable object even if you |
|
|||
69 | didn't type explicit parentheses. For example, 'str 43' becomes |
|
|||
70 | 'str(43)' automatically. The value can be '0' to disable the feature, |
|
|||
71 | '1' for smart autocall, where it is not applied if there are no more |
|
|||
72 | arguments on the line, and '2' for full autocall, where all callable |
|
|||
73 | objects are automatically called (even if no arguments are |
|
|||
74 | present). The default is '1'. |
|
|||
75 |
|
||||
76 | ``--[no-]autoindent`` |
|
|||
77 | Turn automatic indentation on/off. |
|
|||
78 |
|
||||
79 | ``--[no-]automagic`` |
|
|||
80 | make magic commands automatic (without needing their first character |
|
|||
81 | to be %). Type %magic at the IPython prompt for more information. |
|
|||
82 |
|
||||
83 | ``--[no-]autoedit_syntax`` |
|
|||
84 | When a syntax error occurs after editing a file, automatically |
|
|||
85 | open the file to the trouble causing line for convenient |
|
|||
86 | fixing. |
|
|||
87 |
|
||||
88 | ``--[no-]banner`` |
|
|||
89 | Print the initial information banner (default on). |
|
|||
90 |
|
||||
91 | ``-c <command>`` |
|
|||
92 | execute the given command string. This is similar to the -c |
|
|||
93 | option in the normal Python interpreter. |
|
|||
94 |
|
||||
95 | ``--cache-size=<n>`` |
|
|||
96 | size of the output cache (maximum number of entries to hold in |
|
|||
97 | memory). The default is 1000, you can change it permanently in your |
|
|||
98 | config file. Setting it to 0 completely disables the caching system, |
|
|||
99 | and the minimum value accepted is 20 (if you provide a value less than |
|
|||
100 | 20, it is reset to 0 and a warning is issued) This limit is defined |
|
|||
101 | because otherwise you'll spend more time re-flushing a too small cache |
|
|||
102 | than working. |
|
|||
103 |
|
||||
104 | ``--classic`` |
|
|||
105 | Gives IPython a similar feel to the classic Python |
|
|||
106 | prompt. |
|
|||
107 |
|
||||
108 | ``--colors=<scheme>`` |
|
|||
109 | Color scheme for prompts and exception reporting. Currently |
|
|||
110 | implemented: NoColor, Linux and LightBG. |
|
|||
111 |
|
||||
112 | ``--[no-]color_info`` |
|
|||
113 | IPython can display information about objects via a set of functions, |
|
|||
114 | and optionally can use colors for this, syntax highlighting source |
|
|||
115 | code and various other elements. However, because this information is |
|
|||
116 | passed through a pager (like 'less') and many pagers get confused with |
|
|||
117 | color codes, this option is off by default. You can test it and turn |
|
|||
118 | it on permanently in your configuration file if it works for you. As a |
|
|||
119 | reference, the 'less' pager supplied with Mandrake 8.2 works ok, but |
|
|||
120 | that in RedHat 7.2 doesn't. |
|
|||
121 |
|
||||
122 | Test it and turn it on permanently if it works with your |
|
|||
123 | system. The magic function %color_info allows you to toggle this |
|
|||
124 | interactively for testing. |
|
|||
125 |
|
||||
126 | ``--[no-]debug`` |
|
|||
127 | Show information about the loading process. Very useful to pin down |
|
|||
128 | problems with your configuration files or to get details about |
|
|||
129 | session restores. |
|
|||
130 |
|
||||
131 | ``--[no-]deep_reload`` |
|
|||
132 | IPython can use the deep_reload module which reloads changes in |
|
|||
133 | modules recursively (it replaces the reload() function, so you don't |
|
|||
134 | need to change anything to use it). deep_reload() forces a full |
|
|||
135 | reload of modules whose code may have changed, which the default |
|
|||
136 | reload() function does not. |
|
|||
137 |
|
||||
138 | When deep_reload is off, IPython will use the normal reload(), |
|
|||
139 | but deep_reload will still be available as dreload(). This |
|
|||
140 | feature is off by default [which means that you have both |
|
|||
141 | normal reload() and dreload()]. |
|
|||
142 |
|
||||
143 | .. this isn't currently working |
|
|||
144 | .. ``--editor=<name>`` |
|
|||
145 | Which editor to use with the %edit command. By default, |
|
|||
146 | IPython will honor your EDITOR environment variable (if not |
|
|||
147 | set, vi is the Unix default and notepad the Windows one). |
|
|||
148 | Since this editor is invoked on the fly by IPython and is |
|
|||
149 | meant for editing small code snippets, you may want to use a |
|
|||
150 | small, lightweight editor here (in case your default EDITOR is |
|
|||
151 | something like Emacs). |
|
|||
152 |
|
||||
153 | ``--ipython_dir=<name>`` |
|
|||
154 | name of your IPython configuration directory IPYTHON_DIR. This |
|
|||
155 | can also be specified through the environment variable |
|
|||
156 | IPYTHON_DIR. |
|
|||
157 |
|
||||
158 | ``--logfile=<name>`` |
|
|||
159 | specify the name of your logfile. |
|
|||
160 |
|
||||
161 | This implies ``%logstart`` at the beginning of your session |
|
|||
162 |
|
||||
163 | generate a log file of all input. The file is named |
|
|||
164 | ipython_log.py in your current directory (which prevents logs |
|
|||
165 | from multiple IPython sessions from trampling each other). You |
|
|||
166 | can use this to later restore a session by loading your |
|
|||
167 | logfile with ``ipython -i ipython_log.py`` |
|
|||
168 |
|
||||
169 | ``--logplay=<name>`` |
|
|||
170 |
|
||||
171 | NOT AVAILABLE in 0.11 |
|
|||
172 |
|
||||
173 | you can replay a previous log. For restoring a session as close as |
|
|||
174 | possible to the state you left it in, use this option (don't just run |
|
|||
175 | the logfile). With -logplay, IPython will try to reconstruct the |
|
|||
176 | previous working environment in full, not just execute the commands in |
|
|||
177 | the logfile. |
|
|||
178 |
|
||||
179 | When a session is restored, logging is automatically turned on |
|
|||
180 | again with the name of the logfile it was invoked with (it is |
|
|||
181 | read from the log header). So once you've turned logging on for |
|
|||
182 | a session, you can quit IPython and reload it as many times as |
|
|||
183 | you want and it will continue to log its history and restore |
|
|||
184 | from the beginning every time. |
|
|||
185 |
|
||||
186 | Caveats: there are limitations in this option. The history |
|
|||
187 | variables _i*,_* and _dh don't get restored properly. In the |
|
|||
188 | future we will try to implement full session saving by writing |
|
|||
189 | and retrieving a 'snapshot' of the memory state of IPython. But |
|
|||
190 | our first attempts failed because of inherent limitations of |
|
|||
191 | Python's Pickle module, so this may have to wait. |
|
|||
192 |
|
||||
193 | ``--[no-]messages`` |
|
|||
194 | Print messages which IPython collects about its startup |
|
|||
195 | process (default on). |
|
|||
196 |
|
||||
197 | ``--[no-]pdb`` |
|
|||
198 | Automatically call the pdb debugger after every uncaught |
|
|||
199 | exception. If you are used to debugging using pdb, this puts |
|
|||
200 | you automatically inside of it after any call (either in |
|
|||
201 | IPython or in code called by it) which triggers an exception |
|
|||
202 | which goes uncaught. |
|
|||
203 |
|
||||
204 | ``--[no-]pprint`` |
|
|||
205 | ipython can optionally use the pprint (pretty printer) module |
|
|||
206 | for displaying results. pprint tends to give a nicer display |
|
|||
207 | of nested data structures. If you like it, you can turn it on |
|
|||
208 | permanently in your config file (default off). |
|
|||
209 |
|
||||
210 | ``--profile=<name>`` |
|
|||
211 |
|
||||
212 | Select the IPython profile by name. |
|
|||
213 |
|
||||
214 | This is a quick way to keep and load multiple |
|
|||
215 | config files for different tasks, especially if you use the |
|
|||
216 | include option of config files. You can keep a basic |
|
|||
217 | :file:`IPYTHON_DIR/profile_default/ipython_config.py` file |
|
|||
218 | and then have other 'profiles' which |
|
|||
219 | include this one and load extra things for particular |
|
|||
220 | tasks. For example: |
|
|||
221 |
|
||||
222 | 1. $IPYTHON_DIR/profile_default : load basic things you always want. |
|
|||
223 | 2. $IPYTHON_DIR/profile_math : load (1) and basic math-related modules. |
|
|||
224 | 3. $IPYTHON_DIR/profile_numeric : load (1) and Numeric and plotting modules. |
|
|||
225 |
|
||||
226 | Since it is possible to create an endless loop by having |
|
|||
227 | circular file inclusions, IPython will stop if it reaches 15 |
|
|||
228 | recursive inclusions. |
|
|||
229 |
|
||||
230 | ``PromptManager.in_template=<string>`` |
|
|||
231 |
|
||||
232 | Specify the string used for input prompts. Note that if you are using |
|
|||
233 | numbered prompts, the number is represented with a '\#' in the |
|
|||
234 | string. Don't forget to quote strings with spaces embedded in |
|
|||
235 | them. Default: 'In [\#]:'. The :ref:`prompts section <prompts>` |
|
|||
236 | discusses in detail all the available escapes to customize your |
|
|||
237 | prompts. |
|
|||
238 |
|
||||
239 | ``PromptManager.in2_template=<string>`` |
|
|||
240 | Similar to the previous option, but used for the continuation |
|
|||
241 | prompts. The special sequence '\D' is similar to '\#', but |
|
|||
242 | with all digits replaced dots (so you can have your |
|
|||
243 | continuation prompt aligned with your input prompt). Default: |
|
|||
244 | ' .\D.:' (note three spaces at the start for alignment with |
|
|||
245 | 'In [\#]'). |
|
|||
246 |
|
||||
247 | ``PromptManager.out_template=<string>`` |
|
|||
248 | String used for output prompts, also uses numbers like |
|
|||
249 | in_template. Default: 'Out[\#]:' |
|
|||
250 |
|
||||
251 | ``--quick`` |
|
|||
252 | start in bare bones mode (no config file loaded). |
|
|||
253 |
|
||||
254 | ``config_file=<name>`` |
|
|||
255 | name of your IPython resource configuration file. Normally |
|
|||
256 | IPython loads ipython_config.py (from current directory) or |
|
|||
257 | IPYTHON_DIR/profile_default. |
|
|||
258 |
|
||||
259 | If the loading of your config file fails, IPython starts with |
|
|||
260 | a bare bones configuration (no modules loaded at all). |
|
|||
261 |
|
||||
262 | ``--[no-]readline`` |
|
|||
263 | use the readline library, which is needed to support name |
|
|||
264 | completion and command history, among other things. It is |
|
|||
265 | enabled by default, but may cause problems for users of |
|
|||
266 | X/Emacs in Python comint or shell buffers. |
|
|||
267 |
|
||||
268 | Note that X/Emacs 'eterm' buffers (opened with M-x term) support |
|
|||
269 | IPython's readline and syntax coloring fine, only 'emacs' (M-x |
|
|||
270 | shell and C-c !) buffers do not. |
|
|||
271 |
|
||||
272 | ``--TerminalInteractiveShell.screen_length=<n>`` |
|
|||
273 | number of lines of your screen. This is used to control |
|
|||
274 | printing of very long strings. Strings longer than this number |
|
|||
275 | of lines will be sent through a pager instead of directly |
|
|||
276 | printed. |
|
|||
277 |
|
||||
278 | The default value for this is 0, which means IPython will |
|
|||
279 | auto-detect your screen size every time it needs to print certain |
|
|||
280 | potentially long strings (this doesn't change the behavior of the |
|
|||
281 | 'print' keyword, it's only triggered internally). If for some |
|
|||
282 | reason this isn't working well (it needs curses support), specify |
|
|||
283 | it yourself. Otherwise don't change the default. |
|
|||
284 |
|
||||
285 | ``--TerminalInteractiveShell.separate_in=<string>`` |
|
|||
286 |
|
||||
287 | separator before input prompts. |
|
|||
288 | Default: '\n' |
|
|||
289 |
|
||||
290 | ``--TerminalInteractiveShell.separate_out=<string>`` |
|
|||
291 | separator before output prompts. |
|
|||
292 | Default: nothing. |
|
|||
293 |
|
||||
294 | ``--TerminalInteractiveShell.separate_out2=<string>`` |
|
|||
295 | separator after output prompts. |
|
|||
296 | Default: nothing. |
|
|||
297 | For these three options, use the value 0 to specify no separator. |
|
|||
298 |
|
||||
299 | ``--nosep`` |
|
|||
300 | shorthand for setting the above separators to empty strings. |
|
|||
301 |
|
||||
302 | Simply removes all input/output separators. |
|
|||
303 |
|
||||
304 | ``--init`` |
|
|||
305 | allows you to initialize a profile dir for configuration when you |
|
|||
306 | install a new version of IPython or want to use a new profile. |
|
|||
307 | Since new versions may include new command line options or example |
|
|||
308 | files, this copies updated config files. Note that you should probably |
|
|||
309 | use %upgrade instead,it's a safer alternative. |
|
|||
310 |
|
||||
311 | ``--version`` print version information and exit. |
|
|||
312 |
|
||||
313 | ``--xmode=<modename>`` |
|
|||
314 |
|
||||
315 | Mode for exception reporting. |
|
|||
316 |
|
||||
317 | Valid modes: Plain, Context and Verbose. |
|
|||
318 |
|
||||
319 | * Plain: similar to python's normal traceback printing. |
|
|||
320 | * Context: prints 5 lines of context source code around each |
|
|||
321 | line in the traceback. |
|
|||
322 | * Verbose: similar to Context, but additionally prints the |
|
|||
323 | variables currently visible where the exception happened |
|
|||
324 | (shortening their strings if too long). This can potentially be |
|
|||
325 | very slow, if you happen to have a huge data structure whose |
|
|||
326 | string representation is complex to compute. Your computer may |
|
|||
327 | appear to freeze for a while with cpu usage at 100%. If this |
|
|||
328 | occurs, you can cancel the traceback with Ctrl-C (maybe hitting it |
|
|||
329 | more than once). |
|
|||
330 |
|
70 | |||
331 | Interactive use |
|
71 | Interactive use | |
332 | =============== |
|
72 | =============== |
General Comments 0
You need to be logged in to leave comments.
Login now