Skip to content
This repository

We should not insert new lines after all print statements in the notebook #829

Closed
fperez opened this Issue September 30, 2011 · 3 comments

2 participants

Fernando Perez Min RK
Fernando Perez
Owner

We currently, when flushing stdout, are printing somewhere automatically newlines, even if the original data didn't have a trailing newline. This is a small annoyance in some cases, but can be a bigger problem in others: things like numpy.test() that print thousands of dots then become absurdly long and pretty much freeze the browser with a gigantic page.

Min RK
Owner

This needs to be thought about a little carefully. We don't 'insert newlines', rather each published message (caused by stream.flush) gets its own div. In order to match the single-line flush behavior, we would need to append to an existing div. That's not hard to do, but it's slightly ambiguous what should be done, given that there can be stdout, stderr, and display data all produce messages.

  1. only append if the last output was from the same stream - this is the easiest, and probably most logical
  2. streams always stay contiguous for a given message - this lets you easily grab stdout or stderr from a given command, but will result in out-of-order messages if one prints to stdout, then stderr (or publish), then stdout again.

Neither should be difficult, we just have to pick (and there might even be further choices).

Fernando Perez
Owner

@yarikoptic, @minrk and I just chatted and he already knows how to implement approach #1 above, which should pretty much take care of this problem. Thanks for the report!

Min RK minrk closed this October 14, 2011
Min RK
Owner

fixed by PR #830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.