Dictionaries from C

Martin von Loewis loewis at informatik.hu-berlin.de
Sun Oct 8 12:38:01 EDT 2000


kellyk at my-deja.com writes:

> I've been looking for an interface that works similar to Py_BuildValue
> for dictionaries only in reverse.
> 
> for example:
> 
>  PyObject *r= Py_BuildValue("{s:i, s:s}", "blah", 1, "blah2", "asdf");
> 
> will build a dictionary but I can't seem to find an easy way to reverse
> the operation.

There isn't a direct reverse function. Instead, you should use
PyDict_GetItemString.

Regards,
Martin




More information about the Python-list mailing list