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.
Asked
Active
Viewed 80 times
3 Answers
0
Are you using windows? Perhaps try:
import os
os.system(‘cls’)
to clear the console instead.
aquaplane
- 102
- 4
-
No, im using a chromebook. – May 03 '22 at 21:28
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
Alaric Malikov
- 26
- 3