Python - simple reading lines from a pipe,sys.stdout.flush()