Alex Rivera | Logout

Python console application - output above input line

Asked 2013-01-13T02:58:20.657
11

I am trying to write a console application in Python3.

The problem is I would like all output messages EG: print("Status message") to be above the input line at the bottom.

Status message 1
Status message 2
Status message 3
Console:> I want to type here while the output messages displayed

at the moment it looks more like this

Console:>  want to type here while the outStatus message 1
put messages displayed

Is there anyway to do this without using curses?

Edit
Report

1 Answer

3

Try this:

print chr(27)+'[2AOutput'

Hope this is what you are asking for.

Sorry the above is for Python 2.7. I am not sure whether the Python 3 version

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

will work or not.

Ref: http://en.wikipedia.org/wiki/ANSI_escape_code

answered 2013-01-13T03:16:27.807

Your Answer