Python Forum
PyCharm Clear Screen - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: PyCharm Clear Screen (/thread-8463.html)



PyCharm Clear Screen - Larry - Feb-21-2018

How do you clear the screen using PyCharm?


RE: PyCharm Clear Screen - Larz60+ - Feb-21-2018

Pycharm has many screens, which one?
if talking about results screen, click on trash can icon on
bottom left.


RE: PyCharm Clear Screen - Larry - Feb-21-2018

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?


RE: PyCharm Clear Screen - Larz60+ - Feb-21-2018

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.


RE: PyCharm Clear Screen - sparkz_alot - Feb-22-2018

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')