Python Extension in C++ with BGE

Hey all,
I have made an A* pathfinding script that works within BGE, it works well and can distribute the computation over several frames. however, i have looked into using C++ to extend python so i can write the pathfinding in C++, thus making it quicker

i am running windows 7 with python 2.6.4 installed and have been using Quincy 2005 for C++, however whenever i try to

#include <Python.h>

in my code, it says ‘not found’ when it comes to compiling

i believe i need to download the source files for python however i do not know how to do this.
any tips or tuts on extending python with C++ would be useful.

Hope this is in the right place

Thanks in advance

T

If you want to write C++ modules for Python I’d highly recommend looking into Boost.Python. It has a much nicer API than the Python C API.

I have looked into Python:Boost
i have tried to follow the tuts on the boost website but i cannot make it work, does anyone have any examples that work with python 2.6.4?

thanks all

T

#include <Python.h>

in my code, it says ‘not found’ when it comes to compiling

i believe i need to download the source files for python however i do not know how to do this.
First, download and install python:http://www.python.org/download/

After installing python successfully, set your compiler’s include directory to look for:

C:\Python26\include

and set your lib directory to:

C:\Python26\libs

Have fun.

  • DeltaSpeeds

Do you need to do absolute paths in the GE? You didn’t use to, but in 2.49 you do.

The Python/C API isn’t that bad, although it definitely takes a push and a shove to get into it.