【发布时间】:2019-08-08 14:48:22
【问题描述】:
我正在使用祝福(或祝福)来尝试在 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.
等等等等..这是为什么?
【问题讨论】:
标签: python blessed python-blessings