I am using blessings (or blessed) to try to print in the same spot in a for-loop. However, I find that this only works if I print 3 above the bottom of the terminal, but if I print 1 or two lines above the bottom it prints a new line for each iteration...
For y=term.height-3:
from blessed import Terminal
term = Terminal()
print()
print()
for i in range(0,999999999):
with term.location(y=term.height-2):
print('Here is the bottom.')
This code prints this:
Here is the bottom.
It does that for every iteration.
BUT, if I change the print location to
with term.location(y=term.height-1):
It does this
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
Here is the bottom.
and so on and so on.. why is this?
Height of terminal is exclusive: [0,N] => N+1
Let's take N = 3 for simplicity
term.height = 4
term.height - 1 = 3
results in
Now let's do it again, we have this
And you print at line 3