4

I want to print some strings in more than one line and then clear it and overwrite some other strings in stdout.

I know about \r to return and overwrite the current line, but I want to clear every lines in stdout.

and I also know about os.system('clear') to clear the screan but I don't want to clear the whole screen because it clears everything including the commands has been run before running this script and shell statuses.

mehdy
  • 3,174
  • 4
  • 23
  • 44
  • 1
    @GingerPlusPlus no! I want to do it in python and I don't want to use system clear command as I explicitly explained it – mehdy Dec 17 '15 at 20:48
  • You could store the stuff you don't want deleted and then clear the screen with `os.system('clear')` and then reprint what was already there. That might be a possibility but I don't know how your program is setup so maybe not – SirParselot Dec 17 '15 at 20:51
  • @mehdy: I'm sorry, I don't know why I thought it's C++ question. – GingerPlusPlus Dec 17 '15 at 20:52

1 Answers1

0

You're going to have to use the curses package for this sort of thing.

Turn
  • 6,656
  • 32
  • 41