Thanks Diez, It is a good relief that I only need to wrap the classes I need. I decide to try Boost first because it seems to have a wider audience than SIP, but I would definately look into SIP if I want to do Qt development in the future.
Diez B. Roggisch wrote: > > Since the main program is still going to be the C++ application, I > > guess we need to embedding the python scripts in the C++ code. So at > > initialization stage, the python script needs to be loaded into the C++ > > code. And this code can be simple, like > > player = Player() > > game.loadPlayer(player) > > > > > > But for this to work, the python code needs to know the Player class, > > is it right? Does that mean I need to build a python wrapper class for > > Player and "import Player" in the python code? But because this > > application is built on top of a game engine, Player class inherits > > many classes from there, I cannot possibly wrapping them all, right? > > Also, some global objects are probably needed in this code of adding > > players, how can the python code access the > You should look into SIP besides the tools you already mentioned - IMHO it > is the best choice for wrapping C++. > > And yes, you need to wrap classes - but only those that are of interest for > you! So if you need Player, wrap Player. No need to wrap it's base-classes, > unless you want these for other purposes, too. > > And for global objects I'd create functions which return these. > > I suggest you try and download a project that uses one of the possible > toolkits for wrapping - the most prominent user of SIP is of course PyQt. > Go and have a look at the source, how things are done. There aresome > tutorials I think, google should help you on that. > > HTH Diez -- http://mail.python.org/mailman/listinfo/python-list