I want to write a program that reads stdin (unbuffered) and writes stdout (unbuffered) doing some trivial char-by-char transformation. For the sake of the example let\'s say
Read from sys.stdin and write to sys.stdout (or use print). Your example program:
sys.stdin
sys.stdout
print
import sys for line in sys.stdin: print line.replace("x", ""),
There isn't a standard way to make stdin unbuffered, and you don't want that. Let the OS buffer it.