IPython 8.4.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
run_ast_nodes(self, nodelist: List[ast.stmt], cell_name: str, interactivity='last_expr', compiler=<built-in function compile>, result=None)

Parameters

nodelist : list

A sequence of AST nodes to run.

cell_name : str

Will be passed to the compiler as the filename of the cell. Typically the value returned by ip.compile.cache(cell).

interactivity : str

'all', 'last', 'last_expr' , 'last_expr_or_assign' or 'none', specifying which nodes should be run interactively (displaying output from expressions). 'last_expr' will run the last node interactively only if it is an expression (i.e. expressions in loops or other blocks are not displayed) 'last_expr_or_assign' will run the last expression or the last assignment. Other values for this parameter will raise a ValueError.

compiler : callable

A function with the same interface as the built-in compile(), to turn the AST nodes into code objects. Default is the built-in compile().

result : ExecutionResult, optional

An object to store exceptions that occur during execution.

Returns

True if an exception occurred while running code, False if it finished
running.

Run a sequence of AST nodes. The execution mode depends on the interactivity parameter.

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/core/interactiveshell.py#3238
type: <class 'function'>
Commit: