473,799 Members | 3,146 Online
Bytes | Software Development & Data Engineering Community
+ 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 3430

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

Similar topics

15
2473
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 single line program as "select.py" and try to run it. Then exit IDLE and try to restart IDLE.
1
2796
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, nothing appears on my Windows 2000 screen. However, if I look at the task manager, I see "pythonw.exe", which I assume applies that the process is indeed running. I expect some sort of GUI to open.
1
3060
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 both msvcrtd.lib and msvcprtd.lib? Bye Chris
1
1890
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 to perform static linking with MSVCRT.lib or do I have to ship MSVCRT.DLL together with my .exe? /Michael
0
1457
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 2003 we only get partial functionality. So far we have noticed that when the components are returning large set of data that they fail. The following errors are entered in the Event Log and point to msvcrt.dll and oleaut32.dll. In this...
7
3439
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 for Python built by te python.org team is compiled with Microsoft Visual Studio 2003. It is linked with the C runtime msvcrt71.dll. The copyright to msvcrt71.dll is owned by Microsoft, and it is not an integral part of the Windows operating system....
18
81296
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 currently will not execute properly there). I installed VS 2005 SP1 and the hot fix SP for Vista on my Windows Vista system and have rebuilt the entire solution there with everything working well. This solution also builds a setup package that...
11
20827
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
764
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
9546
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10260
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7570
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.