[FWD] Re: [IPython-dev] questions about the notebook interface

Hans Meine hans_meine at gmx.net
Mon Jul 4 08:43:17 EDT 2005

On Friday 01 July 2005 09:40, Fernando Perez wrote:
> >>From: Hans Meine <meine at kogs1.informatik.uni-hamburg.de>
BTW: Sorry for reposting my mail, I did not see/read your forward due to time 

> Indeed, the interactive aspect is pretty dear to my heart (I wouldn't have
> spent all this time developing ipython if I dindn't care about that :). 
> And I think that Tzanko has a good shot at making headway pretty quickly on
> this front with ipython+pycrust.  A while ago I tried to embed ipython in
> IDLE and pycrust; while it didn't quite work, it seemed to me like the
> remaining problems were easy to solve.

Cool.  That's what I dreamt of.. ;-)

> Yup, this is really annoying.  For much of this, Xemacs+ipython.el can be a
> better solution, as you can keep a scratch.py buffer where you do
> multi-line edits, and run them in the ipython buffer with C-c C-|.

I did not find ipython.el that impressive; it surely has advantages 
(multi-line editing), but also disadvantages (crude shell feeling).

> >>I successfully analyzed some data derived from images.  Now I want to
> >> change some preprocessing parameters and re-run the analysis.  Again, I
> >> want to insert / change some code at the beginning and re-execute
> >> several blocks of commands that use the now changed variables.
> This one is already doable in ipython: just call
> macro mm 12:30 34 39:50
> and then typing mm is like re-executing all those lines.

Ah yes, I repeatedly made mental notes to myself to try that out, but did not 
use it yet.  Indeed, that seems to fill a gap.  Thanks for your pointers!

> My current favorite idea is for the notebook format to have some kind of
> include directive like:
> markup.graphic('foo.png',options...)
> Once a fancy GUI is up and running which can display text and inline
> graphics, they could be shown on-screen.  But at least rendering them to
> PS/PDF should be easy.  Note that the GUI for this is not trivial: I think
> that only Qt4 (released yesterday) has a rich text widget with inline
> graphics support.  I may be wrong, but I think that none of the text
> widgets in GTK, Tk or WX have this capability.

I know Qt3 well and it "supports"(*) it, and I think I saw some 
graphics-capable richtext in another toolkit-demo, too.  Hmm, gtk-demo does 
not have it (2.4.9).

*: Qt4 will have a *much* nicer richtext API though.  The 3.3 one is hard to 
extend anyways (e.g. by subclassing, since quite some stuff is private).

> That's why I'm 
> concentrating on having proper backend support for now, along with  a basic
> GUI which can at least display the text parts and provide the interactive
> support.

Good plan.

> This would give us the possibility to:
> 1. Edit the notebooks 'by hand' with plain editors, even if interactive
> support isn't there.
> 2. Have a gui with interactive support that can provide the ability to
> re-edit the same input group multiple times without re-generating new input
> cells.
> If both systems can operate on the same files, one could switch back and
> forth between the editor and the interactive environment, depending on the
> task at hand (heavy-duty coding or multiple tests).

I love that idea.

> >>A friend of mine wants to be able to write longer Mathematic-like
> >> notebooks, and needs proper namespacing for chapters/sections, so that
> >> variable names can be re-used.
> This can be done by issuing a 'del' statement at the start, much like in
> Mathematica you need to call Clear[] on symbols.

Hmm.  Does that still allow to re-run code in the previous section that refers 
to the deleted variables?  My impression is that 'del' is not enough, but 
there need to be separate namespaces, no?

Ciao, /  /
    /  / ANS

More information about the IPython-dev mailing list