##// END OF EJS Templates
some fixs
some fixs

File last commit:

r7210:2ab8717b
r7448:f50baeec
Show More
direct_view_widget.ipynb
254 lines | 9.5 KiB | text/plain | TextLexer
/ docs / examples / parallel / direct_view_widget.ipynb

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.

In [4]:
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:

In [5]:
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.

In [6]:
directview.interact(dv)
SandBoxed(IPython.core.display.Javascript object)
Out[6]:
<IPython.frontend.html.notebook.widgets.directview.DirectViewWidget at 0x107eb9890>