Open avriLee opened 6 years ago
em,i tried it and found if we follow as i mentioned above, Comm is unnecessary, while customizing the execution of codes in kernel is the key. Here's my personal 'solution':
require([
'services/kernels/kernel'
], function(kernel) {
kernel.Kernel.prototype._execute = kernel.Kernel.prototype.execute;
kernel.Kernel.prototype.execute = function (code, callbacks, options) {
// var str = 'foo = 0\n';
var str = '{code}';
code = str + code;
return this._execute(code, callbacks, options);
};
});
So, it may evolve into: is there any public or recommended way to customize the execution?
Hi, all
Description: We want to use the data from web page(frontend) in the code cell. Now we just know
Comm
and try to use it as following:SEND
button in web page, register Comm, and send the excepted data:comm.send({'test': 0})
@my_comm.on_msg def _recv(msg): try:
modify the default execution