9

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

呪いを使わずにこれを行う方法はありますか?

4

2 に答える 2

3

これを試して:

print chr(27)+'[2AOutput'

これがあなたが求めているものであることを願っています。

申し訳ありませんが、上記は Python 2.7 用です。Python 3 バージョンかどうかはわかりません

print(chr(27)+'[2AOutput')

動作するかどうか。

参照: http://en.wikipedia.org/wiki/ANSI_escape_code

于 2013-01-13T03:16:27.807 に答える