##// END OF EJS Templates
Update docs about embedding.
Thomas Kluyver -
Show More
@@ -104,21 +104,18 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
104 stack_depth=1, global_ns=None):
104 stack_depth=1, global_ns=None):
105 """Activate the interactive interpreter.
105 """Activate the interactive interpreter.
106
106
107 __call__(self,header='',local_ns=None,global_ns,dummy=None) -> Start
107 __call__(self,header='',local_ns=None,module=None,dummy=None) -> Start
108 the interpreter shell with the given local and global namespaces, and
108 the interpreter shell with the given local and global namespaces, and
109 optionally print a header string at startup.
109 optionally print a header string at startup.
110
110
111 The shell can be globally activated/deactivated using the
111 The shell can be globally activated/deactivated using the
112 set/get_dummy_mode methods. This allows you to turn off a shell used
112 dummy_mode attribute. This allows you to turn off a shell used
113 for debugging globally.
113 for debugging globally.
114
114
115 However, *each* time you call the shell you can override the current
115 However, *each* time you call the shell you can override the current
116 state of dummy_mode with the optional keyword parameter 'dummy'. For
116 state of dummy_mode with the optional keyword parameter 'dummy'. For
117 example, if you set dummy mode on with IPShell.set_dummy_mode(1), you
117 example, if you set dummy mode on with IPShell.dummy_mode = True, you
118 can still have a specific call work by making it as IPShell(dummy=0).
118 can still have a specific call work by making it as IPShell(dummy=False).
119
120 The optional keyword parameter dummy controls whether the call
121 actually does anything.
122 """
119 """
123
120
124 # If the user has turned it off, go away
121 # If the user has turned it off, go away
@@ -160,13 +157,13 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
160
157
161 - header: An optional header message can be specified.
158 - header: An optional header message can be specified.
162
159
163 - local_ns, global_ns: working namespaces. If given as None, the
160 - local_ns, module: working local namespace (a dict) and module (a
164 IPython-initialized one is updated with __main__.__dict__, so that
161 module or similar object). If given as None, they are automatically
165 program variables become visible but user-specific configuration
162 taken from the scope where the shell was called, so that
166 remains possible.
163 program variables become visible.
167
164
168 - stack_depth: specifies how many levels in the stack to go to
165 - stack_depth: specifies how many levels in the stack to go to
169 looking for namespaces (when local_ns and global_ns are None). This
166 looking for namespaces (when local_ns or module is None). This
170 allows an intermediate caller to make sure that this function gets
167 allows an intermediate caller to make sure that this function gets
171 the namespace from the intended level in the stack. By default (0)
168 the namespace from the intended level in the stack. By default (0)
172 it will get its locals and globals from the immediate caller.
169 it will get its locals and globals from the immediate caller.
@@ -145,10 +145,12 b' Backwards incompatible changes'
145 The full path will still work, and is necessary for using custom launchers not in
145 The full path will still work, and is necessary for using custom launchers not in
146 IPython's launcher module.
146 IPython's launcher module.
147
147
148 * For embedding a shell, note that the parameter ``user_global_ns`` has been
148 * For embedding a shell, note that the parameters ``user_global_ns`` and ``global_ns``
149 replaced by ``user_module``, and expects a module-like object, rather than
149 have been deprectated in favour of ``user_module`` and ``module`` respsectively.
150 a namespace dict. The ``user_ns`` parameter works the same way as before, and
150 The new parameters expect a module-like object, rather than a namespace dict.
151 The old parameters remain for backwards compatibility, although ``user_global_ns``
152 is now ignored. The ``user_ns`` parameter works the same way as before, and
151 calling :func:`~IPython.frontend.terminal.embed.embed` with no arguments still
153 calling :func:`~IPython.frontend.terminal.embed.embed` with no arguments still
152 works the same way.
154 works as before.
153
155
154 .. * use bullet list
156 .. * use bullet list
General Comments 0
You need to be logged in to leave comments. Login now