Search code examples
pythongoogle-colaboratory

How to Clear Python Output Programatically in Google Colaboratory?


This question is specific to Google Colaboratory, while some solutions may work in a normal Python interperter, Google Colaboratory does not seem to allow me to programatically clear the Python interpreter output.

Solutions that I have already tried that do not work:

import os
os.system('cls')
os.system('clear')
!cls
!clear

Solution

  • from IPython.display import clear_output clear_output()

    This is useful to me.