pythonscreenpython-cmd

How can I clear screen in python cmd?


How can I clear the screen from former results in python cmd? I want to clear the screen in each level of a loop, I mean how to clear the results and print the new one instead of that?


Solution

  • This ?

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