0

This might sound a bit crazy but is there a way we can create a Python function in my local and make it behave like an inbuilt function. The purpose is to create a function to clear the console using the below code:

import os
clear = lambda: os.system('clear')
clear()

Here, I need to define the clear() function such that it is available every time I open the Python interpreter the same way I can call any other inbuilt function like print() or max(), etc.

Note: I am not looking to create a function like a bash command but a python function that works inside the interpreter.

Manu mathew
  • 859
  • 8
  • 25

0 Answers0