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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...