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


Groups > comp.lang.python > #11615 > unrolled thread

Determine what msvcrt.getch() is getting?

Started byJohn Doe <jdoe@usenetlove.invalid>
First post2011-08-16 21:43 +0000
Last post2011-08-16 20:06 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  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

#11615 — Determine what msvcrt.getch() is getting?

FromJohn Doe <jdoe@usenetlove.invalid>
Date2011-08-16 21:43 +0000
SubjectDetermine what msvcrt.getch() is getting?
Message-ID<4e4ae499$0$14418$c3e8da3$a8a65a91@news.astraweb.com>
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.

Thanks.

[toc] | [next] | [standalone]


#11630

FromJerry Hill <malaclypse2@gmail.com>
Date2011-08-16 20:06 -0400
Message-ID<mailman.105.1313539606.27778.python-list@python.org>
In reply to#11615
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web