ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 25 Dec 2014 16:50:01 +0100Interacts not working in IPython notebookhttps://ask.sagemath.org/question/25344/interacts-not-working-in-ipython-notebook/I'm running Sage 6.4.1 (on Ubuntu 14.04 and Firefox 34.0) and using the IPython notebook. It's a great interface, but interactives aren't working. For example, the following brings up a bunch of HTML rather than an actual interactive.
@interact
def test(a=(-3,3)):
p=plot(a*sin(x), (x,-2*pi, 2*pi))
show(p)
Do interactives work differently in the IPython notebook?Wed, 24 Dec 2014 21:42:00 +0100https://ask.sagemath.org/question/25344/interacts-not-working-in-ipython-notebook/Answer by tmonteil for <p>I'm running Sage 6.4.1 (on Ubuntu 14.04 and Firefox 34.0) and using the IPython notebook. It's a great interface, but interactives aren't working. For example, the following brings up a bunch of HTML rather than an actual interactive.</p>
<pre><code>@interact
def test(a=(-3,3)):
p=plot(a*sin(x), (x,-2*pi, 2*pi))
show(p)
</code></pre>
<p>Do interactives work differently in the IPython notebook?</p>
https://ask.sagemath.org/question/25344/interacts-not-working-in-ipython-notebook/?answer=25345#post-id-25345Yes, the `@interact` decorator is (currently) specific to the standard Sage notebook, since it produces raw html that is escaped by ipython notebook. If you want to have interacts within ipython notebook right now, you can have a look at [this page](http://nbviewer.ipython.org/github/adrn/ipython/blob/master/examples/Interactive%20Widgets/Index.ipynb) and [this example page](https://github.com/ipython/ipython/tree/master/examples/Interactive%20Widgets).
On the Sage development side, there is still some work to get the best of both.
Thu, 25 Dec 2014 16:50:01 +0100https://ask.sagemath.org/question/25344/interacts-not-working-in-ipython-notebook/?answer=25345#post-id-25345