Original Post
When embedding python (not extending) can it somehow call functions and see globals in your main EXE? Most of the docs on the net including boost.python seem to be mostly for extending python, i.e creating extension DLLs. I can't seem to wrap my brain around how to get good bi directional object communcation. It seems it's either one way or the other. You can either make DLLs that are called by python or run python scripts from your EXE. It gets weird if you mix the two, since Python needs DLLs to call any C++ code. I would like to skip the DLLs and only embed, but still have bi-direcitonal code communication. For an example of what i'm trying to achieve: I have a C++ class called Player that being compiled in my EXE. Player has a member function called Think() that gets called once per game cycle. I would like this function to be implemented in Python. No problem so far. I want that same function to be able to call other member functions of the Player class and have access to some global C++ functions and objects. How can Python know about these things? If you have to extend in this case, then how will Python be able to manipulate that particular instance of the Player class in the EXE? If Player is defined in an extension DLL, then it seems it would not be using my instance of Player but some 'private' Player in that DLL. Is there is a better solution to my Player example? Is it a bad idea currently to have a class where some functions are implemented in C++ and some in Python? Is there any docs that explains these specific issues, as it seems most docs are either oriented towards either embedding or extending but not a combination of the two.