Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ipythonjavascript客户端API_Ipython_Jupyter - Fatal编程技术网

ipythonjavascript客户端API

ipythonjavascript客户端API,ipython,jupyter,Ipython,Jupyter,IPython是否提供了一个Javascript客户端API来连接内核服务器 我了解了前端和内核之间的有线协议 我很想了解当前的web客户端如何与内核通信,特别是如何利用JavaScript从我自己的自定义web客户端以编程方式创建新的笔记本 谢谢请参见 在这里,您可以看到一个很好的示例: // a very basic output handling var handle_output = function (data) {console.log(data);} //callbacks is

IPython是否提供了一个Javascript客户端API来连接内核服务器

我了解了前端和内核之间的有线协议

我很想了解当前的web客户端如何与内核通信,特别是如何利用JavaScript从我自己的自定义web客户端以编程方式创建新的笔记本

谢谢

请参见

在这里,您可以看到一个很好的示例:

// a very basic output handling
var handle_output = function (data) {console.log(data);}

//callbacks is an object whose so special, it appears to only have been documented in
//the source code, as no only google found me a link.
//callbacks.iopub.output is used to get the data from execute
var callbacks = {
        iopub : {
             output : handle_output,
    }
}

//execute anything you want; if a string value is returned
//you can print it out and pass it to the callbacks 
//(or do other things, no idea, it's poorly documented online 
//(read the 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)
您可以在/static/services/kernels/kernel.js中看到定义