I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here.
How do I clear python's IDLE window?
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here.
How do I clear python's IDLE window?
Your screenshot shows you're using IDLE.
cls
/clear
won't work for you."command + L" for MAC OS X.
"contorl + L " for Ubuntu
That does is perfectly. No '0' printed either.
It seems it is impossible to do it without any external library.
An alternative way if you are using windows and don't want to open and close the shell everytime you want to clear it is by using windows command prompt.
Type
python
and hit enter to turn windows command prompt to python idle (make sure python is installed).Type
quit()
and hit enter to turn it back to windows command prompt.Type
cls
and hit enter to clear the command prompt/ windows shell.If you want to clear the shell buffer go to shell > restart shell in IDLE. Your question is a little vague. Do you want to clear the shell buffer or are you trying to call the OS command?
use this