I’m wondering if there’s a way to delete text from the command line console that was printed earlier, so that I can print to the same line again and again.
I know that it’s possible with other scripting/programming languages - some people create animated ASCII art like that: http://www.asciimation.co.nz/
I would like to display some script output without spamming dozens of lines.
I think what you are looking for is carriage return if you are interested in getting back to the beginning of the line without starting a new line. Although if your console does not support it you might not be able to use it in Python.
Here is a list of ascii escape codes that might help you out in Python
i think he’s going more for using a shell to show dynamic text on the same line, instead of printing out a huge log. sphinx, the python documentation generator, has code to do this. i haven’t looked into it myself, but they have a special logger that will show colored progress bars and generation status all through ascii text in a shell. it works on linux and osx, but probably not too well on windows, given it’s lackluster terminal support
Ideally what you want an interface like Ncurses, but it is only available for Posix systems. This is an advanced terminal library. I have not written anything using it but I use alot of apps that use Ncurses.
Alternatively you can get Ncurses running under Windows via Cygwin environment.