does ipython provide javascript client api interfacing kernel server?
i had @ https://ipython.org/ipython-doc/dev/development/messaging.html explains wire protocol between front-end , kernel.
i interested in finding out how current web client communicates kernel , in particular how leverage javascript in order programmatically create new notebooks own custom web client
thanks
see https://gist.github.com/disarticulate/d06069ff3e71cf828e5329beab8cb084
there can see nice example:
// basic output handling var handle_output = function (data) {console.log(data);} //callbacks object special, appears have been documented in //the source code, no google found me link. //callbacks.iopub.output used data execute var callbacks = { iopub : { output : handle_output, } } //execute want; if string value returned //you can print out , pass callbacks //(or other things, no idea, it's poorly documented online //(read source f12->static/notebook/js/services/kernels/kernel.js) //kernel.js/kernel.prototype.execute var kernel = ipython.notebook.kernel; kernel.execute("print(json.dumps(python_dict))",callbacks) you can see definition going in /static/services/kernels/kernel.js
Comments
Post a Comment