Injecting a C side object into the local dict

Jamie R. Parent jamie.parent at sympatico.ca
Fri Feb 11 10:32:44 EST 2005


Hello,

How do you go about taking a variable which was declared in C and pass
that through to a Python script? I have tried doing this by adding a
simple string which is a PyObject from C into the local dictionary and
retrieving it from script via a locals()["myCvar"] print statement.
This however does not seem to work. It would seem that when the scripts
are ran the local dictionary with the added item is wiped clean and a
new local dictionary is instead used. Any direction or help would be
appreciated.

Cheers,
Jamie.




More information about the Python-list mailing list