[C++-sig] Expanding embedded code

Robin Gilks robin.gilks at tait.co.nz
Fri Apr 24 07:19:38 CEST 2009


Stefan Seefeld wrote:
>
> I'm not sure what you are asking. Sticking to my example code, when 
> you run the python script, 'instance' will be available in the global 
> namespace, so you can make calls into it from Python. If that is not 
> what you want, can you come up with another example ?
>
> Thanks,
>       Stefan
>
The problem is my lack of Python knowledge - the 35+ years assembler 
experience doesn't seem to count!!

I've attached a minimal set of files and a make file that I hope will 
illustrate the problem. I'm generating the bindings using pybindgen 
(version 0.10.0). I hope that just typing make will show all my 
mistakes!! The test1.py python script has the questions - how do I get 
the specific instance of the class already instantiated before calling 
the script to be referenced rather than a new instance. I'm passing the 
class pointer across to the script in a PyCObject but once in the python 
domain I don't have a clue as to what to do with it!!

Note - I'm specifically using pybindgen so I can read the generated code 
- Boost makes my brain hurt...

Cheers

-- 
Robin





=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
 altered or corrupted during transmission.
=======================================================================

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20090424/c0957773/attachment-0001.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test1.py
Type: text/x-python
Size: 565 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20090424/c0957773/attachment-0002.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testclass.C
Type: text/x-csrc
Size: 2037 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20090424/c0957773/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testclass.H
Type: text/x-chdr
Size: 584 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20090424/c0957773/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testclassgen.py
Type: text/x-python
Size: 1083 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20090424/c0957773/attachment-0003.py>


More information about the Cplusplus-sig mailing list