Reputation: 391
I am running a Python script in Jupyter Notebook and a library I am using (PyNN), produces a lot of stderr output that slows down the code and fills up the memory. I have tried using %%capture at the beginning of the cell but nothing has changed, and the output remains the same.
I am posting a snap of the output.
Any tips are appreciated. Thanks
Upvotes: 5
Views: 4037
Reputation: 1
I use css to workaround:
%%html
<style>
div.output_stderr {
display: none;
}
</style>
Upvotes: 0
Reputation: 19694
If the issue is with printing, you can redirect the stream with contextlib
:
import contextlib
import os
devnull = open(os.devnull, 'w')
contextlib.redirect_stderr(devnull)
Upvotes: 2