random keypress bounce in a terminal
Hi all, I'm a novice in the world of Python and to begin with something useful I want to create a small tool for my microcontroller work. So I wrote a binary file compare (called bfc). It is just a few lines and put here with two sample files: http://www.evoran.hu/tmp I have found a keypress handler and built into my program. It works fine as long as I hit keys normally, but gives extra characterts if I keep pressing some key, e.g. up or down arrow keys. It runs on a Linux system. What's the wrong with it? Thanks for any help, István -- http://mail.python.org/mailman/listinfo/python-list
Re: random keypress bounce in a terminal
Bjoern Schliessmann írta: > István wrote: > > >> It works fine as long as I hit keys normally, but gives extra >> characterts if I keep pressing some key, e.g. up or down arrow >> keys. It runs on a Linux system. What's the wrong with it? >> > > Nothing. Linux VTs will generate multiple characters for special > keys. > I know it and I do handle it: ch = sys.stdin.read(1) if (ord(ch)==27): chstr=ch chstr+=sys.stdin.read(1) chstr+=sys.stdin.read(1) else: chstr=ch Moreover, I would also state for others: the behavior of this code is independent of the keyboard repeating rate. But what if it _seems_ to work differently...? That's the reason of trying to make somebody just to see him/herself the symptom. * bfc.py 4863 bytes <http://evoran.hu/tmp/bfc.py>* * uni_getch.py 873 bytes <http://evoran.hu/tmp/uni_getch.py>* * demo1.brd 84311 bytes <http://evoran.hu/tmp/demo1.brd>* * demo2.brd 84336 bytes <http://evoran.hu/tmp/demo2.brd> http://www.evoran.hu/tmp/ *Please, check somebody and explain how is possible what is impossible Istvan -- http://mail.python.org/mailman/listinfo/python-list
novice list
Could somebody suggest me a novice Python list, please? Thanks, Istvan -- http://mail.python.org/mailman/listinfo/python-list
Re: Python seems to be ignoring my except clause...
Hi Adam, def characters(self, string): > Please note that "string" is also a name of a very commonly used module so it is not advised to use as a local variable name. Istvan -- http://mail.python.org/mailman/listinfo/python-list
How can I get the target platform info of a dll with Python 3.1.1?
I have many dll files and I would like to select them into two different folders (PC and PPC). For this I need to know the target platform of the dll file or any other details about its platform. I use Python 3.1.1. I have tried the win32api which does not compatible with this Python version. So, I try to use the ctypes.windll with try-except method where the try is true the loaded- in dll is "PC" and if not, unable to load the dll that is "PPC". But, I have a problem with this idea. There are some dll files which I know that "PC" dll but unable to load in memory. The try-except does not work with them. So, I need to request info from the dll file about the target platform of itself. Do you have any idea about this problem? Many thanks for your help. -- http://mail.python.org/mailman/listinfo/python-list