code: def pack_list(fmt, data):
      '''Convert a Python list into a ctypes buffer.
  
      This appears to be faster than the typical method of creating a ctypes
      array, e.g. (c_float * len(data))(*data)
      '''
      func = struct.Struct(fmt).pack
      return create_string_buffer(''.join([func(x) for x in data])f pack_list(fmt, data):
      '''Convert a Python list into a ctypes buffer.
  
      This appears to be faster than the typical method of creating a ctypes
      array, e.g. (c_float * len(data))(*data)
      '''
      func = struct.Struct(fmt).pack
      return create_string_buffer(''.join([func(x) for x in data]))
docs: Convert a Python list into a ctypes buffer.
  
      This appears to be faster than the typical method of creating a ctypes
      array, e.g. (c_float * len(data))(*data)