How to limit the number of output lines in a given cell of the Ipython notebook?

jupyter-notebook

Solution

You can suppress output using this command:

‘;’ at the end of a line 

Perhaps create a condition in your loop to suppress output past a certain threshold.

Problem

Sometimes my Ipython notebooks crash because I left a `print` statement in a big loop or in a recursive function. The kernel shows `busy` and the `stop` button is usually unresponsive. Eventually Chrome asks me if I want to kill the page or wait. Is there a way to limit the number of output lines in a given cell? Or any other way to avoid this problem?

Original source