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

Robert Kern robert.kern at gmail.com
Sat Apr 17 21:08:50 EDT 2010


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 highly recommend using xml.etree to parse and generate a simple XML format.

-- 
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




More information about the IPython-dev mailing list