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

Brian Granger ellisonbg at gmail.com
Sun Apr 25 23:55:18 EDT 2010


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



More information about the IPython-dev mailing list