Mike Meyer wrote:
Craig Ringer <[EMAIL PROTECTED]> writes:


On Sat, 2004-12-18 at 00:40, Amir Dekel wrote:

This must be the silliest question ever:

What about user input in Python? (like stdin)
Where can I find it? I can't find any references to it in the documentation.

Under UNIX, I generally either use curses, or just put the terminal into raw mode:

.>>> def sane():
....    os.system("stty sane")
....
.>>> def raw():
....    os.system("stty raw")


The termios gives module gives you the tools to manipulate the tty
directly, without invoking stty. The tty module gives you an easier
interface to those routines. However, it's missing a setsane
functions. Hmm. I think it's time for another PEP.

<mike

In the pyNMS package (http://sourceforge.net/projects/pynms/) there is a module called "termtools". This module can be used in place of the "tty" module. It has many improvements, including a "sane" function, a "raw" function, and an "stty" function. This module also replaces the "getpass" module, as it has the same functions found there. The PagedIO object is used by the CLI framework in pyNMS.







-- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 ===================================================================== -- http://mail.python.org/mailman/listinfo/python-list

Reply via email to