Embedding Python with C++

merman merman at freenet.de
Tue Apr 9 04:35:45 EDT 2002


"Chris Stoy" <cstoy at nc.rr.com> schrieb im Newsbeitrag
news:GYts8.26982$2J2.6830478 at typhoon.southeast.rr.com...
> Hey all,
>
> I'm looking to embed Python as a scripting language in a game I am working
> on.  I want to be able to call C++ methods from Python, and call Python
from
> C++ (for the usual code quick in Python, convert to C++ for speed later.)
>
> I've looked into using the Boost.Python code and I'm fine with that.
>
> My problem is, I have no clue how to compile Python into a static linked
> library for Windows.  Actually, I need it to be cross-platform, which is
> another issue.
>
> I've never embedded Python before, and I'm fairly new to Python, so can
> someone please give me a pointer to how to do this?  What are the files I
> need to compile to build the static lib (using MS Visual Studio 6.0?)
Also,
> I don't need all of the standard Python components (like networking.)  Can
> those be removed from the lib?
>
> Thanks.
>
> Chris.
>

Hi Chris,

I'm also a python-newbie. My problem is the same:

> I want to be able to call C++ methods from Python.

I have tried a few days with 'swig' (www.swig.org) - but there was no
success (under win2k & bcc55-compiler, commandline).
Maybe you can work with VS6 (recommand in the SWIG-doc) better with SWIG ...
.

Hope this helps

o-o

Thomas
















More information about the Python-list mailing list