Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Injecting a C side object into the local dict

Reply
Thread Tools

Injecting a C side object into the local dict

 
 
Jamie R. Parent
Guest
Posts: n/a
 
      02-11-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.

 
Reply With Quote
 
 
 
 
python
Guest
Posts: n/a
 
      02-11-2005
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Injecting local variable to a function - Can it be done? tai Javascript 6 11-19-2006 08:54 PM
PLEASE HELP: injecting a wsdl doc into an application amine zejli ASP .Net 1 10-20-2003 04:03 PM
PLEASE HELP: injecting a wsdl doc into a .NET application Amine Zejli ASP .Net 1 10-19-2003 03:36 AM
PLEASE HELP: injecting a wsdl document into a .NET app. amine zejli ASP .Net 0 10-19-2003 12:56 AM
Injecting code into the <head></head> section Brian W ASP .Net 10 07-02-2003 07:53 PM



Advertisments