bundles / jupyter_client latest / jupyter_client / client / KernelClient / _async_execute_interactive
function
jupyter_client.client:KernelClient._async_execute_interactive
source: /jupyter_client/client.py:448
Signature
async def _async_execute_interactive(self, code: str, silent: bool = False, store_history: bool = True, user_expressions: t.Dict[str, t.Any] | None = None, allow_stdin: bool | None = None, stop_on_error: bool = True, timeout: float | None = None, output_hook: t.Callable | None = None, stdin_hook: t.Callable | None = None) → t.Dict[str, t.Any]Summary
Execute code in the kernel interactively
Extended Summary
Output will be redisplayed, and stdin prompts will be relayed as well. If an IPython kernel is detected, rich output will be displayed.
You can pass a custom output_hook callable that will be called with every IOPub message that is produced instead of the default redisplay.
Parameters
code: strA string of code in the kernel's language.
silent: bool, optional (default False)If set, the kernel will execute the code as quietly possible, and will force store_history to be False.
store_history: bool, optional (default True)If set, the kernel will store command history. This is forced to be False if silent is True.
user_expressions: dict, optionalA dict mapping names to expressions to be evaluated in the user's dict. The expression values are returned as strings formatted using repr.
allow_stdin: bool, optional (default self.allow_stdin)Flag for whether the kernel can send stdin requests to frontends.
Some frontends (e.g. the Notebook) do not support stdin requests. If raw_input is called from code executed from such a frontend, a StdinNotImplementedError will be raised.
stop_on_error: bool, optional (default True)Flag whether to abort the execution queue, if an exception is encountered.
timeout: float or None (default: None)Timeout to use when waiting for a reply
output_hook: callable(msg)Function to be called with output messages. If not specified, output will be redisplayed.
stdin_hook: callable(msg)Function or awaitable to be called with stdin_request messages. If not specified, input/getpass will be called.
Returns
: reply: dictThe reply message for this request
Aliases
jupyter_client.AsyncKernelClient.execute_interactive