I have the following Python script that reads numbers and outputs an error if the input is not a number.
import fileinput import sys for line in (txt.strip()
The first time it considers it to be input, the second time it's for keeps!
This only occurs when the input is from a tty. It is likely because of the terminal settings where characters are buffered until a newline (carriage return) is entered.