IPython 8.4.0 Pypi GitHub Homepage
Other Docs
Parameters
mainloop(self, local_ns=None, module=None, stack_depth=0, compile_flags=None)

Parameters

local_ns, module :

Working local namespace (a dict) and module (a module or similar object). If given as None, they are automatically taken from the scope where the shell was called, so that program variables become visible.

stack_depth : int

How many levels in the stack to go to looking for namespaces (when local_ns or module is None). This allows an intermediate caller to make sure that this function gets the namespace from the intended level in the stack. By default (0) it will get its locals and globals from the immediate caller.

compile_flags :

A bit field identifying the __future__ features that are enabled, as passed to the builtin compile function. If given as None, they are automatically taken from the scope where the shell was called.

Embeds IPython into a running python program.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /IPython/terminal/embed.py#257
type: <class 'function'>
Commit: