0

OK, pretty basic question, but I cannot find it on google because apparently everyone who asks it phrases it wrong: In batch files, QBasic, and a couple of other languages there is a "cls" command, which basically clears all printed items and inputs from the display before continuing with the program. So, to make things painfully clear, if ran the program without putting cls in between my prints, the command shell would say:

Hello World!

How are you?

But if I did put cls in between them, the Hello world would be replaced by how are you.

Anyway, is there an equivalent to the cls command in Python? And I don't want this:

    os.system('cls')
legoscia
  • 38,687
  • 22
  • 110
  • 157
user2218101
  • 135
  • 2
  • 4
  • 10
  • 1
    Do you care about portability, or is Windows support sufficient? – Robᵩ Oct 21 '13 at 22:58
  • install ipython, it is built-in – Zeugma Oct 21 '13 at 22:59
  • whats wrong with `os.system("cls")` just out of curiousity? since it does exactly what you want to? – Joran Beasley Oct 21 '13 at 23:07
  • Rob - Windows is fine, but portability is always better. Boud - Could you be more specific? Why do I need to install it if it is built in? After installing it, what should I do? Joran - Because os.system('cls') does not do this within IDLE, it executes in a command shell. – user2218101 Oct 21 '13 at 23:35

0 Answers0