Need Help with Python/C API

Carsten Haese carsten at uniqsys.com
Thu Jan 19 15:34:56 CET 2006


On Thu, 2006-01-19 at 00:44, pycraze wrote:
> Hi guys,
> 
>     I Need to know how do i create a dictionary... eg:
> n = pali_hash
> n={}
> n={1:{ } }   ->  i need to know how to make a key of a dictionary, to a
> dictionary using Python/C API's

You can either use Py_BuildValue (See
http://docs.python.org/api/arg-parsing.html#l2h-214) or PyDict_New and
PyDict_SetItem (See http://docs.python.org/api/dictObjects.html) to
construct a dictionary.

Good luck,

Carsten.




More information about the Python-list mailing list