def write_to_stdin(self, message):
if not self.is_running():<EOL><INDENT>raise ConuException(<EOL>"<STR_LIT>")<EOL><DEDENT>if not self.popen_instance:<EOL><INDENT>raise ConuException(<EOL>"<STR_LIT>")<EOL><DEDENT>if not self.popen_instance.stdin:<EOL><INDENT>raise ConuException(<EOL>"<STR_LIT>")<EOL><DEDENT>if not isinstance(message, bytes):<EOL><INDENT>if isinstance(message, str):<EOL><INDENT>message = message.encode()<EOL><DEDENT>else:<EOL><INDENT>raise ConuException(<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>try:<EOL><INDENT>self.popen_instance.stdin.write(message)<EOL>self.popen_instance.stdin.flush()<EOL><DEDENT>except subprocess.CalledProcessError as e:<EOL><INDENT>raise ConuException(e)<EOL><DEDENT>
Write provided text to container's standard input. In order to make this function work, there needs to be several conditions met:
 * the container needs to be running
 * the container needs to have stdin open
 * the container has to be created using method `run_via_binary_in_foreground`

For more info see documentation in run_via_binary_in_foreground()

:param message: str or bytes, text to be written to container standard input