我正在尝试用 Python3 编写一个控制台应用程序。
问题是我希望所有输出消息 EG: print("Status message") 位于底部输入行的上方。
Status message 1
Status message 2
Status message 3
Console:> I want to type here while the output messages displayed
目前看起来更像是这样
Console:> want to type here while the outStatus message 1
put messages displayed
有没有办法不使用 curses 来做到这一点?
最佳答案
试试这个:
print chr(27)+'[2AOutput'
希望这就是您所要求的。
抱歉,以上内容适用于 Python 2.7。我不确定是否是 Python 3 版本
print(chr(27)+'[2AOutput')
是否会工作。
关于Python 控制台应用程序 - 在输入行上方输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14300245/