[IPython-dev] Interactive magic cells
Doug Blank
doug.blank at gmail.com
Fri Jul 18 07:50:52 EDT 2014
On Fri, Jul 18, 2014 at 3:25 AM, Akim Demaille <akim at lrde.epita.fr> wrote:
> [Resend: I sent the message without having subscribed, and my
> message never showed up, and I never received a message telling
> me that I needed to be member to post. The info page of the list
> does not mention that either, I think it should.]
>
> Hi all,
>
> I'm working on an interactive (textual) means to edit an automaton
> in the notebooks. It looks like this:
>
>
> I'm using a TextareaWidget to let the user type in her automaton,
> and an HTMLWidget for te SVG output from dot. It is interactive
> in that I use on_trait_change on the text area to decide whether
> to update the output.
>
> I have two questions: is there a simple means to control the frequency
> of the updates? When the user is typing, I don't need to receive all
> the updates, waiting for a quiet period should be enough. But this
> I guess I can't do by myself, don't worry.
>
> My real question is: I'd like to avoid the text area and rather
> have a cell magic that would look like:
>
>
> I can easily do that with usual cell magic functions, but I'd like
> to have auto evaluation, so that we don't have to wait for the user
> to hit shift-enter. Is there a means to do that?
>
Cool project! "Live coding" for Finite State Machines!
There probably a few places you could insert JavaScript into the keypress
handling process. Perhaps an easy way would be to add a CodeMirror overlay
[1]. You could not only fire your code to check to see if you want to
re-render the dot output, but could also add some custom parsing for your
language.
When you have a complete description, you can probably call something like
the JavaScript IPython.notebook.get_cell(n).execute().
Hope that helps,
-Doug
[1]
http://stackoverflow.com/questions/12343922/codemirror-with-spell-checker -
the last answer I just added which works inside an notebook.
>
> Thanks in advance!
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140718/7a95a2c0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.png
Type: image/png
Size: 37240 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140718/7a95a2c0/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-5.png
Type: image/png
Size: 45383 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140718/7a95a2c0/attachment-0001.png>
More information about the IPython-dev
mailing list