Write a Python program to clear the screen or terminal.

Write a Python program to clear the screen or terminal.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import os
import time
# for windows
# os.system('cls')
os.system("ls")
time.sleep(2)
# Ubuntu version 10.10
os.system('clear')

F

Final output

Leave a Comment