is used for function parameter transfer, so PyObject_GetAttrString cannot be used
滿天的星座2017-06-10 09:50:40
PyByteArray_FromStringAndSize or Py_BuildValue first converts char * into bytes
Then PyTuple_SetItem converts bytes into tuple
PyObject * bytesObject = PyByteArray_FromStringAndSize(message, len);
PyObject * buildObject = Py_BuildValue("y#", message,len);
PyObject * argsObject = PyTuple_New(1);
PyTuple_SetItem(argsObject, 0, bytesObject);