[EMAIL PROTECTED] wrote:
> I tried something like this and it has not worked.
Oh! What did you ask of it, what did you expect and what did you get?
> if ( (item = PyDict_GetItemString( vdict , "atab1")) != NULL )
> PyArg_ParseTuple( item , "i" , &atab1 );
This code expects a dictionary in which keys 'atab1' and 'atab2' are
singletons of integer. If that's what you want, I'd say it should work.
> // ndict = Py_BuildValue( ........create dictionary here ..........)
>
> return ndict ;
> }
I personnally prefer 'return Py_BuildValue("");' than returning NULL
pointers (but I don't like to check the doc just to make sure NULL can
be interpreted as None).
In order to build a dictionary you could try:
...
return Py_BuildValue("{s:i,s:i}", "key1", atab1, "key2", atab2);
}
Or even "{s:(i),s:(i)}" to have singletons for values.
HTH
--
http://mail.python.org/mailman/listinfo/python-list