I have a python program that outputs a few numpy matricies and some other information to my terminal in this fashion:
Currently, to view the data, I follow this order:
- Print data
- Clear Screen
- Re print (and repeat)
However, this is really inefficient. What I would like to be able to do is to see the numbers changing as the program runs, but without the overhead of screen clearing. Is there a way I can format my output using native python so that I won't have to to this expensive operation? The idea is I can have something that works like htop (or similar formatted terminal programs, such as cmus).
curses
docs.python.org/2/howto/curses.html Otherwise you're at the mercy of stdout