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
Ability to silence a cell in the notebook #1863
Comments
It's a reasonable wishlist item, but nothing exists out of the box for it, I'm afraid.The one thing that's in the wings and that will help quite a bit with noisy output is #1825, which at least will contain the noise into a scrollable area rather than making a huge mess. But it's still not a toggle for all stdout. |
In the meantime I suppose I will just use different cells for the noisy command and the command producing the output/plot. |
A cell magic that captures stdout/err, like I do in some parallel tests might be useful. If you want to actually discard just stdout, you can use |
See #1870 |
New `%%capture` cell magic captures stdout/err while running a cell. Uses `capture_output()` context manager, moved to utils.io from IPython.parallel testing utilities, where it originated. The caputre objects can be printed as a string, case in which they display the captured stdout, which is also available as `.stdout`. The captured stderr, if any, is in a `.stderr` attribute. A `.show()` method can be called to quickly print both, with stderr being correctly printed to the sys.stderr stream (so the notebook displays it with red highlighting). closes ipython#1863
There are some functions in scipy that do not provide a way to silence them and they always pollute stdout with useless information. Usually I would just redirect
sys.stdout
, however this causes the notebook to hang.Can a magic
%noprint
be provided in order to silence the stdout?Or another option will be to have
toggle stdout
next totoggle output
in the cell menu?What can be used as a workaround?
The text was updated successfully, but these errors were encountered: