my question is about interactive Jupyter notebooks.
I want to display JavaScript button and print something to cell as result of button click.
We can do this easely with ipywidgets:
def OnClick(b=None): print 'qq'
b = widgets.Button(description='Button')
b.on_click(OnClick)
display(b)
But when we jumps to pure JavaScript things goes wrong. I.e. I have JavaScript Button, in on_click() event handler I use kernel interaction like:
var kernel = IPython.notebook.kernel;
kernel.execute('onClick()');
Callback is called successfuly (I checked by beep), but print produce no output in cell, where by button is displayed. So I suppose there should be some magic (like everyting in Python world!) to acceess print area, could you please help me to cast it?