Jump to content

python interpreter command line


hisoka

Recommended Posts

I would like to clear python interpreter command line . I know that there a command like :

 

import os

os.system('cls')

 

you invoke the OS to clear the interpreter command line . Is there a more short , simple and elegant command that clear python interpreter command line ?

 

Link to comment
Share on other sites

Here's a stackoverflow article about it: http://stackoverflow.com/questions/517970/how-to-clear-python-interpreter-console

 

You can make a lambda to shorten the code:

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

Then you can call clear() as often as you want

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...