(self, num, mode=b'IOAR', not_open=error.BAD_FILE_NUMBER)
return the_file
Get the file object for a file number and check allowed mode.
Get the file object for a file number and check allowed mode.
Get the file object for a file number and check allowed mode .
def get(self, num, mode=b'IOAR', not_open=error.BAD_FILE_NUMBER):
        """Get the file object for a file number and check allowed mode."""
        if (num < 1):
            raise error.BASICError(error.BAD_FILE_NUMBER)
        try:
            the_file = self.files[num]
        except KeyError:
            raise error.BASICError(not_open)
        if the_file.mode.upper() not in mode:
            raise error.BASICError(error.BAD_FILE_MODE)
        return the_file
def get ( self , num , mode = b'IOAR' , not_open = error . BAD_FILE_NUMBER ) : if ( num < 1 ) : raise error . BASICError ( error . BAD_FILE_NUMBER ) try : the_file = self . files [ num ] except KeyError : raise error . BASICError ( not_open ) if the_file . mode . upper ( ) not in mode : raise error . BASICError ( error . BAD_FILE_MODE ) return the_file