0

I've been having trouble clearing the console on python. I've tried to do Console.Clear() and clear() but for some reason they haven't been working.

3 Answers3

0

Are you using windows? Perhaps try:

import os
os.system(‘cls’)

to clear the console instead.

aquaplane
  • 102
  • 4
0

I think this will help you: Click here

There are multiple ways depends on your operating system

The fastest option would be:

print("\033c", end='')

Good luck :)

Mark
  • 96
  • 2
  • I'm using a website called replit, and I found out how to clear the console. Thank you anyway! –  May 03 '22 at 21:33
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 04 '22 at 03:38
0

For MacOS and Linux:

import os
os.system("clear")

for Windows:

import os
os.system("cls")
jirassimok
  • 3,072
  • 2
  • 13
  • 21