stdout is not a tty python