Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #11630

Re: Determine what msvcrt.getch() is getting?

References <4e4ae499$0$14418$c3e8da3$a8a65a91@news.astraweb.com>
Date 2011-08-16 20:06 -0400
Subject Re: Determine what msvcrt.getch() is getting?
From Jerry Hill <malaclypse2@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.105.1313539606.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Aug 16, 2011 at 5:43 PM, John Doe <jdoe@usenetlove.invalid> wrote:
> Whatever msvcrt.getch() is returning here in Windows, it's not within
> the 1-255 number range. How can I determine what it is returning?
>
> I would like to see whatever it is getting.

Just print it.  Like this:

import msvcrt
ch = msvcrt.getch()
print (ch)

for a bit more information, do this instead:
import msvcrt
ch = msvcrt.getch()
print(type(ch), repr(ch), ord(ch))

-- 
Jerry

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Determine what msvcrt.getch() is getting? John Doe <jdoe@usenetlove.invalid> - 2011-08-16 21:43 +0000
  Re: Determine what msvcrt.getch() is getting? Jerry Hill <malaclypse2@gmail.com> - 2011-08-16 20:06 -0400

csiph-web