[IPython-dev] notebook-like format for IPythonQt sessions.

Carlos Córdoba ccordoba12 at gmail.com
Thu Apr 29 11:41:52 EDT 2010


Whatever the format for saving sessions is chosen, I think it would be a
great idea if one could execute a whole notebook from the terminal with
something like:

ipython -nb foo.inb (inb = ipython notebook)

or call it with the %run magic. This way you could write self-contained
programs with IpythonQt and use ipython as an interpreter to run them.

I'm very fond of literate
programming<http://en.wikipedia.org/wiki/Special%3ASearch/literate_programming>and
I think it would be very useful to write programs as text (with
sections, subsections, equations, figures, etc) but with the possibility to
run them as easily as possible.

Carlos

2010/4/25 Brian Granger <ellisonbg at gmail.com>

> On Sat, Apr 17, 2010 at 6:08 PM, Robert Kern <robert.kern at gmail.com>
> wrote:
> > On 2010-04-17 19:02 , Gerardo Gutierrez wrote:
> >> Ok i'm going to paste a fragment of a document about this topic (that
> >> I've not noticed until today)
> >>
> >>
> >> /The frontend would store, for now, 5 types of data:
> >>
> >> #. Input: this is python/ipython code to be executed.
> >>
> >> #. Output (python): result of executing Inputs.
> >>
> >> #. Standard output: from subprocesses.
> >>
> >> #. Standard error: from subprocesses.
> >>
> >> #. Text: arbitrary text. For now, we'll just store plain text and will
> defer
> >> to the user on how to format it, though it should be valid reST if it is
> >> later to be converted into html/pdf.
> >>
> >> The non-text cells would be stored on-disk as follows::
> >>
> >> .. input-cell::
> >> :id: 1
> >>
> >> 3+3
> >>
> >> .. output-cell::
> >> :id: 1
> >>
> >> 6
> >>
> >> .. input-cell::
> >> :id: 2
> >>
> >> ls
> >>
> >> .. stdout-cell::
> >> :id: 2
> >>
> >> a.py b.py
> >>
> >> .. input-cell::
> >> :id: 3
> >>
> >> !askdfj
> >>
> >> .. stderr-cell::
> >> :id: 3
> >>
> >> sh: askdfj: command not found/
> >>
> >>
> >> This document clears some ideas, since the natural way for an IPython's
> >> frontend (not only IPythonQt) to load data is rst in wich Python's and
> >> IPython's documentation is written.
> >
> > I would not say that it is natural, no. reST is a fine text markup, but
> not a
> > very good datastore. The parser is difficult to work with, and there
> aren't any
> > tools for generating valid reST from a parsed description.
>
> I agree with Robert that reST is probably not the best option for this.
>
> > I highly recommend using xml.etree to parse and generate a simple XML
> format.
>
> I am not quite as excited about XML as Robert, but my feeling is this:
>  it should be XML unless someone comes up with an option that beats
> it.
>
> Cheers,
>
> Brian
>
> > --
> > Robert Kern
> >
> > "I have come to believe that the whole world is an enigma, a harmless
> enigma
> >  that is made terrible by our own mad attempt to interpret it as though
> it had
> >  an underlying truth."
> >   -- Umberto Eco
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
>
>
>
> --
> Brian E. Granger, Ph.D.
> Assistant Professor of Physics
> Cal Poly State University, San Luis Obispo
> bgranger at calpoly.edu
> ellisonbg at gmail.com
> _______________________________________________
> 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/20100429/41ea52a9/attachment.html>


More information about the IPython-dev mailing list