(self)
Read a character with line ending replacement (INPUT and LINE INPUT).
Read a character with line ending replacement (INPUT and LINE INPUT).
Read a character with line ending replacement ( INPUT and LINE INPUT ) .
def read_one(self):
        """Read a character with line ending replacement (INPUT and LINE INPUT)."""
        # take char out of readahead buffer, if present; blocking keyboard read otherwise
        if self._readahead:
            chars, self._readahead = b''.join(self._readahead[:1]), self._readahead[1:]
            return chars
        else:
            # note that we need string length, not list length
            # as read_bytes_kybd_file can return multi-byte eascii codes
            # blocking read
            return b''.join(
                # INPUT and LINE INPUT on KYBD files replace some eascii with control sequences
                KYBD_REPLACE.get(c, c)
                for c in self._keyboard.read_bytes_kybd_file(1)
            )
def read_one ( self ) : # take char out of readahead buffer, if present; blocking keyboard read otherwise if self . _readahead : chars , self . _readahead = b'' . join ( self . _readahead [ : 1 ] ) , self . _readahead [ 1 : ] return chars else : # note that we need string length, not list length # as read_bytes_kybd_file can return multi-byte eascii codes # blocking read return b'' . join ( # INPUT and LINE INPUT on KYBD files replace some eascii with control sequences KYBD_REPLACE . get ( c , c ) for c in self . _keyboard . read_bytes_kybd_file ( 1 ) )