I am new on Python and I want to clear the shell. I've tried CTRL+L, os.system('cls') and sp.call('cls',shell=True) but that only outputs 0.
Asked
Active
Viewed 278 times
1
-
1Maybe this will help: https://stackoverflow.com/questions/517970/how-to-clear-the-interpreter-console – Manualmsdos Feb 18 '19 at 02:46
1 Answers
0
(CTRL+L will not work if you are using Windows. Sorry.)
MORE: sp.call('cls',shell=True) only works on OS X in shell.
EVEN MORE: os.system('cls') (for windows only), works for Terminal window(CMD) presuming you are using OS X: Here's a solution I found:
import subprocess as sp
tmp = sp.call('cls',shell=True)
Hope this helps, The snake 727.
-
@WuffleTuffle If this is not the right answer, leave a comment to explain why. Thanks! – Apr 06 '20 at 14:49