(self, args)
return self._values.new_string().from_str(word)
INPUT$: read num chars from file.
INPUT$: read num chars from file.
INPUT$ : read num chars from file .
def input_(self, args):
        """INPUT$: read num chars from file."""
        num = values.to_int(next(args))
        error.range_check(1, 255, num)
        filenum = next(args)
        if filenum is not None:
            filenum = values.to_int(filenum)
            error.range_check(0, 255, filenum)
            # raise BAD FILE MODE (not BAD FILE NUMBER) if the file is not open
            file_obj = self.get(filenum, mode=b'IR', not_open=error.BAD_FILE_MODE)
        else:
            file_obj = self.kybd_file
        list(args)
        # read the chars
        word = file_obj.read(num)
        if len(word) < num:
            # input past end
            raise error.BASICError(error.INPUT_PAST_END)
        return self._values.new_string().from_str(word)
def input_ ( self , args ) : num = values . to_int ( next ( args ) ) error . range_check ( 1 , 255 , num ) filenum = next ( args ) if filenum is not None : filenum = values . to_int ( filenum ) error . range_check ( 0 , 255 , filenum ) # raise BAD FILE MODE (not BAD FILE NUMBER) if the file is not open file_obj = self . get ( filenum , mode = b'IR' , not_open = error . BAD_FILE_MODE ) else : file_obj = self . kybd_file list ( args ) # read the chars word = file_obj . read ( num ) if len ( word ) < num : # input past end raise error . BASICError ( error . INPUT_PAST_END ) return self . _values . new_string ( ) . from_str ( word )