Direct View Widget¶
IPython has a JavaScript widget for interacting with an IPython parallel engine interactively in the Notebook. This Notebook shows how this widget can be used.
from IPython.frontend.html.notebook.widgets import directview
from IPython.parallel import Client
Let's create a Client
and build a DirectView
containing all of the engines:
c = Client()
dv = c[:]
To interact with the engines we simply pass the DirectView
instance to the interact
function. The resulting widget has an embedded notebook cell, but any code entered into the embedded cell is run on the engines you choose. The engines are now full blown IPython kernels so you can enter arbitrary Python/IPython code and even make plots on the engines.
directview.interact(dv)