473,470 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

IDLE and msvcrt getch()



Yes, another newbie question. :-)

When I run the following from idle, the msvcrt.getch() function always
returns 255 and it doesn't wait for a key press. It also displays the
key on the screen when it should not.
import msvcrt

while 1:
k = msvcrt.getch()
print k
if k == 'q':
break
If i run it from a standard console window it works fine. Is this
normal in that it works this way for everyone?

It seems like idle's keyboard routines are getting in the way. Any
way around this?


Jul 18 '05 #1
0 3413

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Aubrey Hutchison | last post by:
### this will test if your version of IDLE on windows is a MATURE program design ### print "Hello world, If Python IDLE is a mature program design it will output this" Save this simple...
1
by: Paul Dankoski | last post by:
Hello. I downloaded and installed Windows Python-2.3.exe. The install appears to be successful. There is a Start menu item showing "Python 2.3" --> "IDLE (Python GUI)". When I select this,...
1
by: Chris | last post by:
Hi I know it's not a good idea to use both msvcrt.lib and msvcrtd.lib in your project, and the same goes for msvcprt.lib and msvcprtd.lib. But is it ok to use both msvcrt.lib and msvcprt.lib? Or...
1
by: Michael | last post by:
Hi! I've developed a simple game that needs to be compiled as a multithreaded dll. I've read that since I use this runtime-library my applications will need MSVCRT.DLL at runtime. Is it possible...
0
by: bluter | last post by:
I have a problem with some VC++ (v5 sp3 compiled in debug mode) server component which perfrom Data Acces. These have been in production on NT4.0 and w2k. However when we try to use them on Server...
7
by: sturlamolden | last post by:
This question has been asked many times, and last time I was accused of spreading FUD. So now I will rather propose a solution. The reason for the problem is as follows: The binary installer...
18
by: =?Utf-8?B?RGF2aWQ=?= | last post by:
I have a VC++ / .NET 2.0 solution built using VS 2005 SP1 under XP. Everything has been working well there over the past year. I have recently starting porting the app to Windows Vista (since it...
11
by: Dick Moores | last post by:
Windows XP Pro, Python 2.5.1 import msvcrt while True: if msvcrt.kbhit(): key = msvcrt.getch() if key == 'Enter' do something Is there a way to catch the pressing of the 'Enter' key?
0
by: Dick Moores | last post by:
Win XP, Python 2.5.1 I'm having trouble using msvcrt.getch() in a program that also uses a graphics module which itself imports Tkinter. Is this to be expected? Thanks, Dick Moores
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.