a portable text user interface ?

J.Jacob joost_jacob at hotmail.com
Fri Feb 8 14:24:37 CET 2002

We would like a -portable- module that provides 4 functions:

setupTextUI(width, height)  # returning a text UI object, top left is

writeXY(textWindow, x, y, string)   # print string on position (x,y)

readXY(textWindow, x, y)    # waiting for user input with cursor
positioned on
                            # (x,y) and returning a string from user

or better function names if you come up with it.

The textWindow parameter is here for the example and not really
because the module could handle it internally.  The text window's top
corner should match the console window's top left.  If the text window
bigger than the console window it just gets clipped.  More functions
are not
needed immediately, e.g. you need to erase part of the window just
spaces there.

With a module like this included in the Python distribution you could
simple text based user interfaces that work on Windows, linux, *nix
and Mac
that dont flicker, that is, if it is well implemented.  It looks so
simple but
it really is not.  You would need to know how to do things on all
I tried and gave up, besides i do not have access to much OS's to test
with.  Doing this for linux and unix is simple with the curses module,
Windows? Mac?  The pdcurses and WConio modules i found for Windows
compilation etc., couldnt test/install them properly (no MS compiler
Cygwin Python has partially implemented curses but then you need to
have Cygwin installed.
What we need is something in the Python distribution -itself- that is
Portable curses would be nice, but maybe its too much to start with,
people would be happy with only a few functions like those above,
like the low/high-Video could come later.

We think a well implemented portable text ui module in the Python
distribution would improve Python a lot.  What do other users think? 
What do
the core Python developers think?  Should it be a PEP?

More information about the Python-list mailing list