Notebook: Document the IPython.notebook.kernel.execute function

Created on 23 Feb 2017  路  2Comments  路  Source: jupyter/notebook

This notebook https://gist.github.com/disarticulate/d06069ff3e71cf828e5329beab8cb084 shows how to run Jupyter.notebook.kernel.execute() in a javascript cell to get data from Python code.

This kind of trick is very useful if you are using D3.js for example, it avoids starting an http server in a different process (my technique so far) just to serve interactive data.

Maybe we can document it somewhere in the documentation ? I would say in Examples section, maybe. #

Documentation

Most helpful comment

I agree!
and thanks for the great looking notebook!
just through that I found out, after a long time...
that the js callbacks need to be in this shape.:

var callbacks = {
        iopub : {
             output : handle_output,
    }
}

I have found several other pages not having the iopub around, which prevents the callback function to be called...

All 2 comments

I agree!
and thanks for the great looking notebook!
just through that I found out, after a long time...
that the js callbacks need to be in this shape.:

var callbacks = {
        iopub : {
             output : handle_output,
    }
}

I have found several other pages not having the iopub around, which prevents the callback function to be called...

Please document this or point to a proper reference about how it should be used: it would be very helpful.

Was this page helpful?
0 / 5 - 0 ratings