Jump to content
hisoka

python interpreter command line

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 ?

 

Share this post


Link to post
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

Share this post


Link to post
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

×