code: def c_array(ctype, values):
      
      if isinstance(values, np.ndarray) and values.dtype.itemsize == ctypes.sizeof(ctype):
          return (ctype * len(values)).from_buffer_copy(values)
      return (ctype * len(values))(*values)
docs: Convert a python string to c array.