新手求教:想在c中调用Python的list,为什么这样转化会报错?应该怎么解决?

求大神指教,代码如下:

 #include "Python.h"
void main()
{
    char* x;
    PyObject* list = PyList_New(0);
    PyList_Append(list,Py_BuildValue("s","Test"));
    PyObject* item = PyList_GetItem(list,0);
    PyArg_ParseTuple(item, "s", &x);
    printf("%s", x);
}

出现如下问题:
图片说明
为什么这样转化会报错?应该怎么解决?如果想要在C中调用Python的list中的值,应该怎么办?

http://bbs.csdn.net/topics/391950563?list=lz

顶一下,求大神解答啊

你需要为x分配空间

 char* x = (char *)malloc(100);
    Py_Initialize();  
    PyObject * pModule = NULL;      
    PyObject * pFunc = NULL;        
    pModule =PyImport_ImportModule("xauxag");      //Test001:Python文件名  
    pFunc= PyObject_GetAttrString(pModule, "Test");  //Add:Python文件中的函数名 
    //返回值  
    PyObject *pReturn = NULL;  
    pReturn = PyEval_CallObject(pFunc, NULL);      //调用函数  
    PyArg_Parse(pReturn, "s", &x);  
    cout <<  x << endl;