[IPython-dev] Executing on Kernel as if CodeCell was executed

Ja Lu jamalumaja at gmail.com
Wed Mar 25 12:04:06 EDT 2015

Hello all,

running code using `IPython.notebook.kernel.execute()` is not
necessarily equivalent to running code from a notebook codecell. I
have some interactive plots embedded in the notebook (Bokeh) and they
only refresh if code is executed from a codecell. This is not due to
the parameters/callbacks passed to `kernel.execute()`. My aim is to
execute my command through Javascript, as if I had ran a codecell.

In `IPython/html/static/notebook/js/codecell.js`, I saw that after
`kernel.execution()` there are calls to `.render()` and
`.events.trigger('execute.CodeCell', ..)`. My guess would be, if I
would somehow evoke these commands after `kernel.execute()` things
would work out. Am I on the right track? Could someone help me on how
to do that exactly through the JS API? From the "outside" I do not
have the reference to `this`.

Thanks a lot, Jan

More information about the IPython-dev mailing list