TextIO | None = None, always_prefer_tty: bool = False) Input

Create the appropriate Input object for the current os/environment.


always_prefer_tty – When set, if sys.stdin is connected to a Unix pipe, check whether sys.stdout or sys.stderr are connected to a pseudo terminal. If so, open the tty for reading instead of reading for sys.stdin. (We can open stdout or stderr for reading, this is how a $PAGER works.)