def open_for_io(self, writable, password):
        """Open the medium for I/O.

        in writable of type bool
            Set this to open the medium for both reading and writing.  When
            not set the medium is opened readonly.

        in password of type str
            Password for accessing an encrypted medium. Must be empty if not encrypted.

        return medium_io of type :class:`IMediumIO`
            Medium I/O object.

        """
        if not isinstance(writable, bool):
            raise TypeError("writable can only be an instance of type bool")
        if not isinstance(password, basestring):
            raise TypeError("password can only be an instance of type basestring")
        medium_io = self._call("openForIO",
                     in_p=[writable, password])
        medium_io = IMediumIO(medium_io)
        return medium_io