Python Forum

Full Version: PyCharm Clear Screen
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do you clear the screen using PyCharm?
Pycharm has many screens, which one?
if talking about results screen, click on trash can icon on
bottom left.
Sorry, I should have been more clear. I want to clear the screen where the program results are printed. And I want to clear the screen during a script. So far I am using a function:

def cls():
print ('\n' * 25)


But that seem clutzy?
as I stated, the trash can icon on the left will do the trick
It's a serial terminal window, so you can't do what you are suggesting.
It has to be manually cleared.
As Larz points out, you cannot clear the output screen except maunualy. Within your script you can use something like:

import os

# Use the next line every time you wish to 'clear' the screen. Works with Windows and Linux.
os.system('cls' if os.name == 'nt' else 'clear')