Skip to content

Commit ee43215

Browse files
committed
Changed clear() to only use os.system on Windows, and use ESCc on everything else
1 parent 5eeaf3c commit ee43215

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

domdf_python_tools/terminal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ def clear():
7676
"""
7777
Clears the display
7878
79-
Works for Windows and UNIX, but does not clear Python Interpreter
79+
Works for Windows and UNIX, but does not clear Python Interpreter or PyCharm Console
8080
"""
8181

82-
os.system('cls' if os.name == 'nt' else 'clear')
82+
if os.name == "nt":
83+
os.system('cls')
84+
else:
85+
print("\033c", end='')
8386

8487

8588
def br():

0 commit comments

Comments
 (0)