Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
clear screen with pycharm
#1
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)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen' Shadower 1 6,171 Feb-06-2019, 01:25 AM
Last Post: woooee
  PyCharm Clear Screen Larry 4 19,084 Feb-22-2018, 12:18 AM
Last Post: sparkz_alot
  How to clear the screen of glitched rectangles? user294869 1 4,132 Mar-03-2017, 09:36 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020