[Tutor] Want to use msvcrt.getch() but can't import msvcrt

Tim Peters tim.peters at gmail.com
Sat Jul 17 19:16:48 CEST 2004


[Dick Moores]
> A week ago or so I asked how I might enable pausing my timer.py. Alan
> Gauld suggested looking at the mscvrt module (which is available for
> Windows) and mscvrt.getch(). He also referred me to a page of his
> tutorial, <http://www.freenetpages.co.uk/hp/alan.gauld/tutor2/tutevent.htm>
>
> This seems to be just what I'm looking for, but when I import mscvrt I get
> "ImportError: No module named mscvrt"

Get ready to kick yourself <wink>.

>>> import mscvrt  # no good
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named mscvrt
>>> import msvcrt  # good
>>>

The name only makes sense to hard-core Windows geeks; it's short for
MicroSoft Visual C Runtime, and exposes some function specific to
Microsoft's Visual C runtime libraries.


More information about the Tutor mailing list