[IPython-dev] Re: Changes to Notebook Format
Robert Kern
rkern at ucsd.edu
Tue Jul 26 13:55:22 EDT 2005
Tzanko Matev wrote:
> Hi all,
>
> I found other problems with the current format. It is entirely possible
> that a single input has several outputs, and prints to stdout and/or
> stderr several times. Take for examlpe the following code.
>
> In [1]: if True:
> ...: 1
> ...: print 'foo'
> ...: 2
> ...: print 'bar'
> ...:
> Out[1]: 1
> foo
> Out[1]: 2
> bar
I've never run into a case where I actually want to see multiple
Out[1]'s. It's usually in the middle of a for loop and I've forgotten
that a function returns an object that I don't really need to see (e.g.
pylab.plot()). Since only the last one actually goes into the output
cache (that is, is accessible for later use via Out[1]), I'm not
convinced that printing multiple Out[1]'s is useful. If I really want to
see something in the middle of a loop, I'll print it.
As for having stdout cells interleaved with other types of output cells,
I think that's going to be pretty hard. You'd have to collect the output
from each statement separately. I'm of the opinion that you should just
collect one each of stdout and stderr.
--
Robert Kern
rkern at ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the IPython-dev
mailing list