getch() of Turbo C in Python?

Alexander V. Voinov avv at quasar.ipa.nw.ru
Fri Jun 8 15:57:35 EDT 2001


Hi

Alex Martelli wrote:

> "Anurag Ved" <anuragved at vsnl.com> wrote in message
> news:fa4233c9.0106071108.7b1c4ed8 at posting.google.com...
>     ...
> > Is there something similar to the getch() function of Turbo C which
> > reads just one key from <stdin> and returns immediately?
>
> Yes, it's called getch() and is exported from module msvcrt (in
> Windows versions of Python).

With the use of pyslang you may probably be able to do this in a
cross-platform way, if you care.

Alexander





More information about the Python-list mailing list