1

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.

1 Answers1

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