[Tutor] Moving my C++ code to Python?

Alan Gauld alan.gauld at btinternet.com
Sat Oct 16 02:03:04 CEST 2010

"Paul" <paulanon at gmail.com> wrote

> I would like to make modules for python.  The problem is that the
> vector of structs that is very large.  First, is it possible to pass
> such structures around to and from python and C/C++?

Yes, Try looking at SWIG for one approach to making C/C++
code accesible to Python which may work for you

> What would be the overhead cost of having a large structure
> that needs to be passed to and from the C/C++ modules?

I'm no expert so can't say for sure but since Pythion tends to
operate with references I'd hope not too much.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list