Python/C API
Joerg Baumann
joerg.baumann at stud.informatik.uni-erlangen.de
Thu Oct 5 14:35:31 EDT 2000
More information about the Python-list mailing list
Thu Oct 5 14:35:31 EDT 2000
- Previous message (by thread): Python/C API
- Next message (by thread): Python/C API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thank you for your hints.
This workes for me:
a=PyImport_AddModule("xyz");
b=PyModule_GetDict(a);
// no Py_DECREF(a)
a=PyDict_GetItemString(b,"foo");
// no Py_DECREF(b)
b=Py_BuildValue("(s)",_ptemp);
c=PyObject_CallObject(a, b);
Py_DECREF(b);
// c holds xyz.foo("test") with refcount 1
bye
joerg
- Previous message (by thread): Python/C API
- Next message (by thread): Python/C API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list