[IPython-dev] how ipython notebook support widget or applet besides HTML and code?
Sat Nov 24 05:10:05 CST 2012
Le 24 nov. 2012 à 04:04, W Gong a écrit :
> I learned ipython notebook a few days ago and like it very much,
> To me, IPython Notebook is a new generation of web browser because it brings exploration and interactivity to user.
> One question is how to add widget support (e.g. embed canvas, drawing board, java applet).
Depending on what you exactly want to do you might have different way of doing it.
The first thing you can do is use display protocol (see docs/example/notebook/display_protocol.ipynb) to define html/latex/json representation for object.
Near the end, you have a youtube video python object which representation is an embedded youtube player.
The other thing we are working on are json plugin
have a look at http://vimeo.com/channels/pydata/53051817
> I have another use-case to embed java applet:
> Nobel Physicist - Carl Wieman at U of Colorado - Bolder has a wonderful science education initiative called PhET which is to bring virtual lab to science students.
> If teachers and students can perform virtual experiment, at the same time, do calculations in math/physics via sympy and write a lab report, all within the IPython notebook, it would be a huge boost to our education.
You should be able to do the same and use a custom _repr_html_ to display this form python.
I think the introduction notebook in /docs/example/notebooks/ are a good start to see what could be done.
also, you can share static version of your notebook through nbviewer.ipython.org.
here is what it looks for yours.
More information about the IPython-dev