-1

I have a command line interface in python as a project and would like to be able to get my terminal to wipe clean after it has completed delivering a set of instructions. Is there a command for this?

martineau
  • 119,623
  • 25
  • 170
  • 301

3 Answers3

0

if you want to clear the terminal from your python code, you can use os.system("clear") on linux or os.system("cls") on windows.

0

I'm not sure I understand your wish properly, but with the intention of helping, if your command line interface is running in a REPL ( Read, Evaluate, Print and Loop) interface - a python shell to execute a single python command and display the result - then the commands used to clear the terminal or Python shell are cls and clear.

Depending on your OS, you can run the following:

Windows

import os
os.system(‘CLS’)

Linux

import os
os.system(‘clear’)

For more details you can check this link

I hope it was of some help!

-1

What IDE are you using? With the Spyder IPython console, you can use CTRL + L.

FreyGeospatial
  • 325
  • 4
  • 17