Using cls() function in Python shell

  1. Create a file named tools.py
  2. now wrtie the below code and save it in lib directory under *\Python\Python38-32\Lib
import os

def cls():
 os.system('cls')

3. Now start python in command shell and import the file by the following code.

>>  from tools import cls
>> cls() # use the command for clear the screen!

Leave a Reply

Your email address will not be published. Required fields are marked *