while True:
    input = ''
c = stdin.read(1)
while c is not EOF:
    input += c
c = stdin.read(1)
for line in input.split('\n'):
    yield line
How do you read from stdin in python from a pipe which has no ending