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
You can select the cell and clear the output by either: Clicking on the clear output button (x) in the toolbar above the cell; or. Right clicking the left gutter of the output area and selecting "Clear output" from the context menu.
from google.colab import output
output.clear()
from IPython.display import clear_output
clear_output()
This is useful to me.
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