Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fperez opened this issue Sep 30, 2011 · 3 comments
Closed

Comments

@fperez
Copy link
Member

fperez commented Sep 30, 2011

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.

@minrk
Copy link
Member

minrk commented Sep 30, 2011

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

@fperez
Copy link
Member Author

fperez commented Sep 30, 2011

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

@minrk
Copy link
Member

minrk commented Oct 14, 2011

fixed by PR #830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants