Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to clear the screen in python [duplicate]

Tags:

python

screen

People also ask

How do you clear the screen in Python?

In an interactive shell/terminal, we can simply use ctrl+l to clear the screen.

How do I clear the screen in Python Visual Studio?

You can clear the Python interpreter console screen using a system call. System calls to clear the console: For the window system, cls clear the console. For the Linux system, clear command works.


If you mean the screen where you have that interpreter prompt >>> you can do CTRL+L on Bash shell can help. Windows does not have equivalent. You can do

import os
os.system('cls')  # on windows

or

os.system('clear')  # on linux / os x