我正在使用祝福(或祝福)来尝试在 for 循环中的同一位置打印。但是,我发现这仅在我在终端底部上方打印 3 时才有效,但如果我在底部上方打印 1 或两行,它会为每次迭代打印一个新行...
对于 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.')
此代码打印:
Here is the bottom.
它对每次迭代都这样做。
但是,如果我将打印位置更改为
with term.location(y=term.height-1):
它这样做
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.
等等等等..这是为什么?