So, my question is whether i should use the os.system('cls') for clearing command line output in a python command line program. I usually use the os module way, however, i have read that using the subprocess modules are a better choice for doing calls to the command line. In general, which should i use? And if i do use the subprocess way, how would i go about doing it, as i have very little experience with the module, even though i have tried reading the doc’s. Thank you in advance for your replies.
So, my question is whether i should use the os.system(‘cls’) for clearing command line
Share
If you want to use the
subprocessmodule to invokeclsinstead ofos.system(), just:If you want something more complex see the subprocess documentation.