Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir()
stuff, help() stuff
my way of doing this is to write a function like so:
import os
import subprocess
def clear():
if os.name in ('nt','dos'):
subprocess.call("cls")
elif os.name in ('linux','osx','posix'):
subprocess.call("clear")
else:
print("\n") * 120
then call clear()
to clear the screen.
this works on windows, osx, linux, bsd... all OSes.