[IPython-dev] Re: Changes to Notebook Format

Fernando Perez Fernando.Perez at colorado.edu
Mon Aug 1 14:51:16 CDT 2005


Fernando Perez wrote:

> Oh, I don't disagree with you that it would be _nice_ to have that 
> interleaving.  The problem is _how_ to do it.  On the implementation end of 
> things (where desires have to become reality), you have an object which can 
> track each of the output streams (stdout/err), and that's about it.  Those 
> animals are buffered to begin with, so knowing in a reliable way when data 
> came into each is not really possible, I think even for a plain shell.

mmh, scratch that.  Upon thinking a bit more, it seems to me that since our 
output proxies have to trap all write() calls, they should be able to 
timestamp each one of them internally.  These timestamps should correspond 
with the actuall call time, not with the results of output showing up on the 
buffered output, so they are indeed enough to reconstruct the call sequence.

The implementation would be still a bit delicate, as you want to tag output to 
each stream as a separate kind, but multiple consecutive write() calls to one 
kind of stream should not create new cells.  Instead, they should continue 
writing to the currently open one, unless the other stream has had a write() 
call made, time at which the code should open a new cell to switch streams. 
It seems possible, but a fair bit of work.

Cheers,

f




More information about the IPython-dev mailing list