code: def write(self, data):
          
          data = data.encode('utf-8')
          data_p = ctypes.create_string_buffer(data)
          num_bytes = PLARGE_INTEGER(LARGE_INTEGER(0))
          bytes_to_write = len(data)
          success = WriteFile(self.conin_pipe, data_p,
                              bytes_to_write, num_bytes, None)
          return success, num_bytes[0]
docs: Write string data to current process input stream.