Attention
This is copied verbatim from the old IPython wiki and is currently under development. Much of the information in this part of the development guide is out of date.
(Note: this page is not currently consistent with IPython/Jupyter master)
Javascript events are used to notify unrelated parts of the notebook interface when something happens. For example, if the kernel is busy executing code, it may send an event announcing as such, which can then be picked up by other services, like the notification area. For details on how the events themselves work, see the JQuery documentation.
This page documents the core set of events, and explains when and why they are triggered.
command_mode.Cell
create.Cell
delete.Cell
edit_mode.Cell
select.Cell
output_appended.OutputArea
preset_activated.CellToolbar
preset_added.CellToolbar
app_initialized.DashboardApp
sessions_loaded.Dashboard
When the Jupyter Notebook browser window opens for the first time and initializes the Dashboard App. The Dashboard App lists the files and notebooks in the current directory. Additionally, it lets you create and open new Jupyter Notebooks.
execution_request.Kernel
input_reply.Kernel
kernel_autorestarting.Kernel
kernel_busy.Kernel
kernel_connected.Kernel
kernel_connection_failed.Kernel
kernel_created.Kernel
kernel_created.Session
kernel_dead.Kernel
kernel_dead.Session
kernel_disconnected.Kernel
kernel_idle.Kernel
kernel_interrupting.Kernel
kernel_killed.Kernel
kernel_killed.Session
kernel_ready.Kernel
kernel_reconnecting.Kernel
kernel_restarting.Kernel
kernel_starting.Kernel
send_input_reply.Kernel
shell_reply.Kernel
spec_changed.Kernel
The kernel has been successfully created or re-created through /api/kernels, but a connection to it has not necessarily been established yet.
/api/kernels
The kernel has been successfully created or re-created through /api/sessions, but a connection to it has not necessarily been established yet.
/api/sessions
An attempt is being made to reconnect (via websockets) to the kernel after having been disconnected.
A connection has been established to the kernel. This is triggered as soon as all websockets (e.g. to the shell, iopub, and stdin channels) have been opened. This does not necessarily mean that the kernel is ready to do anything yet, though.
The kernel is starting. This is triggered once when the kernel process is starting up, and can be sent as a message by the kernel, or may be triggered by the frontend if it knows the kernel is starting (e.g., it created the kernel and is connected to it, but hasn’t been able to communicate with it yet).
Like kernel_idle.Kernel, but triggered after the kernel has fully started up.
The kernel is restarting. This is triggered at the beginning of an restart call to /api/kernels.
The kernel is restarting on its own, which probably also means that something happened to cause the kernel to die. For example, running the following code in the notebook would cause the kernel to autorestart:
import os os._exit(1)
The kernel is being interrupted. This is triggered at the beginning of a interrupt call to /api/kernels.
The connection to the kernel has been lost.
Not only was the connection lost, but it was lost due to an error (i.e., we did not tell the websockets to close).
The kernel’s execution state is ‘idle’.
The kernel’s execution state is ‘busy’.
The kernel has been manually killed through /api/kernels.
The kernel has been manually killed through /api/sessions.
This is triggered if the kernel dies, and the kernel manager attempts to restart it, but is unable to. For example, the following code run in the notebook will cause the kernel to die and for the kernel manager to be unable to restart it:
import os from IPython.kernel.connect import get_connection_file with open(get_connection_file(), 'w') as f: f.write("garbage") os._exit(1)
The kernel could not be started through /api/sessions. This might be because the requested kernel type isn’t installed. Another reason for this message is that the kernel died or was killed, but the session wasn’t.
app_initialized.NotebookApp
autosave_disabled.Notebook
autosave_enabled.Notebook
checkpoint_created.Notebook
checkpoint_delete_failed.Notebook
checkpoint_deleted.Notebook
checkpoint_failed.Notebook
checkpoint_restore_failed.Notebook
checkpoint_restored.Notebook
checkpoints_listed.Notebook
command_mode.Notebook
edit_mode.Notebook
list_checkpoints_failed.Notebook
notebook_load_failed.Notebook
notebook_loaded.Notebook
notebook_loading.Notebook
notebook_rename_failed.Notebook
notebook_renamed.Notebook
notebook_restoring.Notebook
notebook_save_failed.Notebook
notebook_saved.Notebook
notebook_saving.Notebook
rename_notebook.Notebook
selected_cell_type_changed.Notebook
set_dirty.Notebook
set_next_input.Notebook
trust_changed.Notebook
open_with_text.Pager
rebuild.QuickHelp