How can I clear screen in python cmd?

5.6k Views Asked by At

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?

1

There are 1 best solutions below

4
On BEST ANSWER

This ?

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