As you mentioned, you can do a system call:
For Windows:
>>> import os
>>> clear = lambda: os.system('cls')
>>> clear()
For Linux it would be:
>>> import os
>>> clear = lambda: os.system('clear')
>>> clear()
More Related Contents:
- How do I hide the console when I use os.system() or subprocess.call()?
- How to display utf-8 in windows console
- How to avoid console window with .pyw file containing os.system call?
- Run multiple programs sequentially in one Windows command prompt?
- Permanently add a directory to PYTHONPATH?
- How to disable logging on the standard error stream?
- How can I find where Python is installed on Windows?
- Python: how to kill child process(es) when parent dies?
- Windows- Pyinstaller Error “failed to execute script ” When App Clicked
- Python method for reading keypress?
- Compulsory usage of if __name__==”__main__” in windows while using multiprocessing [duplicate]
- What version of Visual Studio is Python on my computer compiled with?
- Using subprocess to run Python script on Windows
- mixed slashes with os.path.join on windows
- Running powershell script within python script, how to make python print the powershell output while it is running
- python’s webbrowser launches IE, instead of default browser, on Windows relative path
- Python raw strings and trailing backslash [duplicate]
- Tensorflow r1.0 : could not a find a version that satisfies the requirement tensorflow
- How do I eliminate Windows consoles from spawned processes in Python (2.7)? [duplicate]
- How do I detect whether sys.stdout is attached to terminal or not? [duplicate]
- How do I read text from the Windows clipboard in Python?
- How to get the text cursor position in Windows?
- How to change the location of the pointer in python?
- Installing lxml, libxml2, libxslt on Windows 8.1
- Trouble installing SciPy on windows
- Installing theano on Windows 8 with GPU enabled
- Python multiprocessing linux windows difference
- How to properly report an exit status in batch?
- How can I stop Python’s csv.DictWriter.writerows from adding empty lines between rows in Windows?
- Fatal Python error on Windows 10 ModuleNotFoundError: No module named ‘encodings’