Skip to content


Subversion checkout URL

You can clone with
Download ZIP


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

fperez opened this Issue · 3 comments

2 participants


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.


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).


@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!


fixed by PR #830

@minrk minrk closed this
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.