Python Forum

Full Version: clear screen with pycharm
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)