How do you suppress output in IPython Notebook?
Add %%capture
as the first line of the cell. eg
%%capture
print('Hello')
MyFunction()
This simply discards the output, but the %%capture
magic can be used to save the output to a variable - consult the docs
Suppress output
Put a ;
at the end of a line to suppress the printing of output [Reference].
(credit: https://stackoverflow.com/a/23611571/389812)
You could use io.capture_output:
from IPython.utils import io
with io.capture_output() as captured:
MyFunction()
to supress (e.g. capture) stdout and stderr for those lines within the with-statement
.