Normally, data becomes available at stdin after a newline.
So you need to put stdin into 'raw mode'. Here is a python program that will read key presses from a raw tty. It stops after 16 presses, because Ctrl-C is not processed either.
import sys
import termios
import tty
attr = termios.tcgetattr( sys.stdin )
tty.setraw( sys.stdin )
for i in range(16) :
d = sys.stdin.read(1)
print ord( d[0] )
print "\r",
termios.tcsetattr( sys.stdin, termios.TCSADRAIN, attr )