Is there a way to hide a single code cell's output in Google Colab?
No one needs to see the sea of pip
logs when we install things:
If you look at the screenshot you'll see I tried to apply one of the solutions from this similar Stack Overflow question: https://stackoverflow.com/a/48084050/1762493
I tried applying TagRemovePreprocessor.remove_single_output_tags
as a #comment
, a @@Magic
, and a !command
but those don't work with this line.
I checked Colab's "Welcome" and "Resource" notebooks but didn't notice anything there for deeper notebook settings: https://colab.research.google.com/notebooks/welcome.ipynb
Is this even possible?
I just realized that you can go to the bottom left corner of the screen and click the button (if you hover over you see that it says "command palette"), then search "fullscreen" you find the button that says view output "fullscreen".
In this case you can just use
!pip install -q gwpy
In general, you can start the cell with %%capture
%%capture
# the rest of your code
I found this answer and applied it successfully: https://serverfault.com/a/41968/328943
Simply adding &> /dev/null
to the tail of any command will silence its output outside of any errors that may arise.
Like so:
!pip install gwpy &> /dev/null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With