[Python-ideas] Remove tty module

Clay Sweetser clay.sweetser at gmail.com
Fri Aug 2 13:19:10 CEST 2013


Actually
On Aug 2, 2013 2:07 AM, "Andrew Barnert" <abarnert at yahoo.com> wrote:
>
> From: Andrew Barnert <abarnert at yahoo.com>
>
> Sent: Thursday, August 1, 2013 9:47 PM
>
>
> > From: "random832 at fastmail.us" <random832 at fastmail.us>
> > Sent: Thursday, August 1, 2013 1:18 PM
>
>
> >>  What about faking conio on Unix?
> >
> > That's a great idea.
>
>
> See https://github.com/abarnert/consoleio for a rough implementation.
>
> You might even be able to "pip install git+
https://github.com/abarnert/consoleio".
>
> It does not work on Python 2.x, although I think it wouldn't be that hard
to make it do so. It probably works on 3.0-3.2, but I haven't tested on
anything earlier than 3.3.0. I also haven't tested on Windows, but if it
doesn't work, it should be trivial to fix.
>
> I went with the idea of only allowing consoleio functions inside an
enabling() context (or explicit enable() and disable() calls) instead of
switching on the fly. It makes khbit easier to implement and to use, and
it's generally simpler, cleaner, and more efficient, and I don't think
anyone will complain too much.
>
> Anyway, if something like were added to the stdlib, it definitely
wouldn't allow us to deprecate tty or termios (especially since it uses
them… but even if it didn't, sometimes you need more flexibility), but it
would allow us to add a note at the top saying "If you're using looking for
simple, more-portable raw I/O, see the consoleio module."

Not to mention finally putting an obvious end to all those questions on
stack overflow and friends, on how to do simple, non-blocking, cross
platform console input.
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130802/7acfde62/attachment.html>


More information about the Python-ideas mailing list