()
return True
To see if we are a console app, check if we can treat stdin like a tty, file or socket.
To see if we are a console app, check if we can treat stdin like a tty, file or socket.
To see if we are a console app check if we can treat stdin like a tty file or socket .
def _is_console_app():
    """To see if we are a console app, check if we can treat stdin like a tty, file or socket."""
    if not sys.stdin.isatty():
        try:
            fcntl.ioctl(sys.stdin, termios.FIONREAD, _sock_size)
        except EnvironmentError:
            # maybe /dev/null, but not a real file or console
            return False
    return True
def _is_console_app ( ) : if not sys . stdin . isatty ( ) : try : fcntl . ioctl ( sys . stdin , termios . FIONREAD , _sock_size ) except EnvironmentError : # maybe /dev/null, but not a real file or console return False return True