Send a script to FORM.

        Write the given script to the communication channel to FORM. It could
        be buffered and so FORM may not execute the sent script until
        :meth:`flush` or :meth:`read` is called.

def write(self, script):
        # type: (str) -> None
        """Send a script to FORM.

        Write the given script to the communication channel to FORM. It could
        be buffered and so FORM may not execute the sent script until
        :meth:`flush` or :meth:`read` is called.
        """
        if self._closed:
            raise IOError('tried to write to closed connection')
        script = script.strip()
        if script:
            assert self._parentout is not None
            self._parentout.write(script)
            self._parentout.write('\n')