I am writing a Python C extension. I am passing a Python dictionary to a C function. I can parse it using the following code:
PyObject *large_dict = NULL; if (! PyArg_ParseTuple( args, "O!", &PyDict_Type, &large_dict)) return NULL; if (large_dict != NULL) { printf("Large Dictionary Not Null\n"); }
The expression "Big Dictionary is not zero" is printed here, which means that the dictionary is being successfully analyzed. Now I want to access the values ββof the dictionary by specifying keys, for example, in python. those. dict ['k1'] and this gives the value v1.
How can I access the keys / values ββof a dictionary inside this C function?
Please suggest me a solution?
source share