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

Omar Andrés Zapata Mesa andresete.chaos at gmail.com
Sat Apr 17 22:16:03 EDT 2010


I think xml  is a good idea, because you can set data in  tags, referencing
different types of inputs and outputs  in the ipython-qt´s editor, like
stdout, stderr, ipython err, ipython out, etc.

some like

<cell number=1>
               <input type=documentation>
                =============================
                rst docuemnation example in ipython-qt
                =============================

               subtitle example
               ------------------------
               etc....
              </input>
</cell>

<cell number=2>
                  <input type=ipython>  %run hello.py </input>
                  <ouput type=stdout> hello world ! </input>
</cell>

<cell number=3>
                   <input type=comment> #some python/iptyhon comment code
</input>
</cell>



2010/4/17 Robert Kern <robert.kern at gmail.com>

> 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
>
> _______________________________________________
> 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/20100417/2f4c30f2/attachment.html>


More information about the IPython-dev mailing list