A completely silly question

Mike Meyer mwm at mired.org
Sun Dec 19 15:15:55 EST 2004


Craig Ringer <craig at postnewspapers.com.au> 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
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list