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.
4 Answers
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 :)
3 Comments
Community
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.
On Windows 10, I use the following code snippet:
import os
def clear(): os.system('cls')
Then, you type in clear(). It does not produce an extra blank line at the very top. This is in contrast to the solution provided by Ryan Duffield which uses lambda (How to clear the interpreter console?). The reason for not having an extra blank line and zero when using a regular function is that the regular function returns None.