(self, num)
return chars
Read a number of characters (INPUT$).
Read a number of characters (INPUT$).
Read a number of characters ( INPUT$ ) .
def read(self, num):
        """Read a number of characters (INPUT$)."""
        # take at most num chars out of readahead buffer (holds just one on KYBD but anyway)
        chars, self._readahead = b''.join(self._readahead[:num]), self._readahead[num:]
        # fill up the rest with actual keyboard reads
        while len(chars) < num:
            chars += b''.join(
                # note that INPUT$ on KYBD files replaces some eascii with NUL
                b'\0' if c in KYBD_REPLACE else c if len(c) == 1 else b''
                for c in self._keyboard.read_bytes_kybd_file(num-len(chars))
            )
        return chars
def read ( self , num ) : # take at most num chars out of readahead buffer (holds just one on KYBD but anyway) chars , self . _readahead = b'' . join ( self . _readahead [ : num ] ) , self . _readahead [ num : ] # fill up the rest with actual keyboard reads while len ( chars ) < num : chars += b'' . join ( # note that INPUT$ on KYBD files replaces some eascii with NUL b'\0' if c in KYBD_REPLACE else c if len ( c ) == 1 else b'' for c in self . _keyboard . read_bytes_kybd_file ( num - len ( chars ) ) ) return chars