I'm writing a small application that monitors a system and prints the system data to the terminal in a loop. Although I have achieved what I want, I want to make it more smart(efficient).
The console output looks something like this:
|------------------|-----------------|-----------|
|Voltage(V) 100|Pressure(bar) 1|RPM XXX|
|Current(A) 2|Temperature1 24| |
|Power(W) 200|Temperature1 23| |
|------------------|-----------------|-----------|
The only thing that keeps updating (dynamic) are the values reported by the system. The texts are static. I don't want the system to keep printing this table below one another. I also don't want to clear the screen from python each time I want to print. this creates a flickering effect on the terminal.
Is there a way to efficiently do this? like load this window when the script executes and just keep updating the values in loop?
tried flushing but this created a flickering effect and also not an efficient way to do it because the static texts are also re-printed each time which is not needed