Clearing Intepreter (Python IDLE) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Clearing Intepreter (Python IDLE)

I would want to clear the intepreter of Python IDLE without closing and re-opening it. Is there any shortcuts to clear it? Like the command prompth has CLS command to clear the command prompth. Not CTRL+F6 (View last restart) Not CTRL+C (Interrupt executiona)

25th May 2019, 10:07 AM
Seb TheS
Seb TheS - avatar
2 Respostas
+ 2
You can use os module to use CLS in system shell. if you are windows, this should work for you: >>>import os >>>os.system("cls") If you don't want to use os module, you can make a function that prints a lot of new lines every time you call it(not really recommended) : >>>def clear(): print('\n'*100)
25th May 2019, 10:13 AM
Ī›M!N
Ī›M!N - avatar
+ 1
Ī›M!N Thanks, but that does not help. os.system("cls") works only on the intepreter launched from the command prompth. With IDLE intepreter it only prints 0, but doesn't clear anything. print("\n"*100) Does something, but it is not comfortable, as I don't want the intepreter to display everything in bottom of the window. I just thought there could have been a shortcut to reopen the intepreter.
25th May 2019, 10:39 AM
Seb TheS
Seb TheS - avatar