Help required accessing dictionary
gagsl-py2 at yahoo.com.ar
Fri Sep 2 21:10:41 CEST 2011
En Wed, 31 Aug 2011 22:46:54 -0300, <mrinalini at edss.co.in> escribió:
> I need to access the dictionary of the script that I am running through
> my vc++ application by embedding python.
> I am linking to python dynamically. I want to obtain the dictionary of
> the script and access the variables declared in the script.
> However, with the PyObject * that I get from the dictionary, I am not
> able to find the type of the object. The reason being that
> GetProcAddress to PyInt_Check returns a NULL. The same thing with
> PyFloat_Check and so on. I think this is because they are macros and
> exported functions.
> What can be done to be able to perform these checks without statically
> linking to the pyhon lib ?
Just include python.h
PyInt_Check is completely implemented as a macro, it doesn't call any
/* from intobject.h */
#define PyInt_Check(op) \
/* from object.h */
#define PyType_FastSubclass(t,f) PyType_HasFeature(t,f)
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
More information about the Python-list