Skip to content
Advertisement

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

Advertisement

Answer

from IPython.display import clear_output clear_output()

This is useful to me.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement