3

Is it possible to limit the number of lines output by a code cell in Google Colaboratory? As to mimic the behavior of the command shell that keeps only the last n lines?

Sometimes it happens that the browser crashes because of the size of the generated tab, due to the huge amount of text produced by debug text.

Is there a solution without having to reduce the amount of text actually generated by the code itself?

crash
  • 4,152
  • 6
  • 33
  • 54

1 Answers1

0

Add %%capture to the top of the cell to completely discard the output.

Found on: How do you suppress output in IPython Notebook?

Nikki
  • 1