Embedding Python with C++

Ken Seehof kseehof at neuralintegrator.com
Tue Apr 9 03:25:24 EDT 2002


Chris Stoy wrote:
> 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?

Oh yeah, I forgot to mention PyGame.  Check it out:
http://www.pygame.org/

- Ken Seehof






More information about the Python-list mailing list