[Tutor] Re: getting input from keyboard

Poor Yorick gp@pooryorick.com
Sat Dec 28 18:39:02 2002


Danny Yoo wrote:

>
>Hello!
>
>I've written a small Cookbook recipe to make using getch() somewhat
>simpler:
>
>    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892
>

 Danny, it looks like your recipe has a typo.  self.impl will always end 
up being _GetchUnix().

    def __init__(self):
        try:
            self.impl = _GetchWindows()
        except ImportError: pass
        self.impl = _GetchUnix()

    def __call__(self): return self.impl()


Poor Yorick
gp@pooryorick.com