You are viewing an older version (9.3.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.3.0 / IPython / core / interactiveshell / InteractiveShell / run_cell

function

IPython.core.interactiveshell:InteractiveShell.run_cell

source: /IPython/core/interactiveshell.py :3061

Signature

def   run_cell ( self raw_cell store_history = False silent = False shell_futures = True cell_id = None )

Summary

Run a complete IPython cell.

Parameters

raw_cell : str

The code (including IPython code such as %magic functions) to run.

store_history : bool

If True, the raw and translated cell will be stored in IPython's history. For user code calling back into IPython's machinery, this should be set to False.

silent : bool

If True, avoid side-effects, such as implicit displayhooks and and logging. silent=True forces store_history=False.

shell_futures : bool

If True, the code will share future statements with the interactive shell. It will both be affected by previous __future__ imports, and any __future__ imports in the code will affect the shell. If False, __future__ imports are not shared in either direction.

cell_id : str, optional

A unique identifier for the cell. This is used in the messaging system to match output with execution requests and for tracking cell execution history across kernel restarts. In notebook contexts, this is typically a UUID generated by the frontend. If None, the kernel may generate an internal identifier or proceed without cell tracking capabilities.

Returns
-------
result : :class:`ExecutionResult`

Aliases

  • IPython.InteractiveShell.run_cell

Referenced by