Python Forum
clear screen with pycharm - 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: clear screen with pycharm (/thread-23129.html)



clear screen with pycharm - boris602 - Dec-12-2019

Hi ,I have found in the internet a code to clear a screen:

def clear_screen():
    os.system('cls' if os.name == 'nt' else 'clear')
However I cannot use it, because if i type

print("nt" in os.name)
os.system("cls")
I get


True

Process finished with exit code 0
as answer. After True there is supposed to be a question mark, that i cannot copy here.
I would be grateful for some help, because I would like to avoid using something like

print('\n'*80)