/async_gui_ipython_kernel

This enables the IPython kernel to receive GUI events while waiting for cells. This should be part of IPykernel 6.0.0.

Primary LanguagePython

Async GUI IPython Kernel

This enables the IPython kernel to receive Comm events while waiting for cells.

Currently, the IPython kernel will only process one message at a time. Including Comm events that are naturally asynchronous. This means you are currently unable to await changes in your ipywidgets. If you do, the await statement will hang indefinitely.

Being able to wait on user input in Jupyter opens up possibilities for building interfaces. For example, in the GIF below, you can await on a GUI that takes a series of inputs.

Demo

Example Async Widget

Quickstart

pip install git+git://github.com/sonthonaxrk/async_gui_ipython_kernel.git#egg=async_gui_ipython_kernel

Make sure to set your kernel to 'Async GUI kernel'.

Disclaimer

This is just an untested hack that could be useful.