Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Injecting a C side object into the local dict (http://www.velocityreviews.com/forums/t341473-injecting-a-c-side-object-into-the-local-dict.html)

Jamie R. Parent 02-11-2005 03:32 PM

Injecting a C side object into the local dict
 
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.


python 02-11-2005 07:31 PM

Re: Injecting a C side object into the local dict
 
Take a look at Pyrex.


<http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/>

More at

<http://www-106.ibm.com/developerworks/library/l-cppyrex.html>


/Jean Brouwers


Jamie R. Parent wrote:
> 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.




All times are GMT. The time now is 08:42 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.