0

Possible Duplicate:
Python read a single character from the user

I am undertaking the crazy task of building an 8bit CPU in python on my pc. I already have the CPU up and running, but wish for a way for the CPU to process user input on its own. To do this I have already specified a memory address to use as I/O, and have worked out how the key strokes could be converted to their numerical equivalents and fed to the CPU, which could be programmed to process the input. I was wondering if there is a OS universal solution for a program to receive individual keystrokes, without the user needing to press enter between inputs. My form tutor at school has informed me that there is unlikely to be a OS universal way to do this in python, but I might be able to find another language which could have a function to handle this part of the code.

So my question is, which languages would allow this functionality, and from there, how would I import that functionality to my python script?

Thanks in advance.

Community
  • 1
  • 1
Xandros
  • 727
  • 1
  • 9
  • 21
  • I don't know about OS un-specific but you could look at C. Python is written in C and there are many ways to link it in quiet easily including Python modules – Joe Doherty Jan 09 '13 at 21:27
  • Your problem with multiple operating systems will be that it's often not the program you're running that makes the decision about buffering input, but the shell or terminal program that started things up. – Carl Norum Jan 09 '13 at 21:32
  • Use python. See this recipe: http://code.activestate.com/recipes/134892/ – Bakuriu Jan 10 '13 at 06:55

0 Answers0