may be you can reading only 1 character at a time using a sys.stdin.read(max) , than read a line..
while True:
rcvdata = sys.stdin.read(1)
if len(rcvdata) == 0:
break
also, check this thread out from SOF :Python sys.stdin.read(max) blocks until max is read (if max>=0), blocks until EOF else, but select indicates there is data to be read
and
sys.stdin.readline() reads without prompt, returning 'nothing in between'