embedding help

Jp Calderone jcaldero at ic.sunysb.edu
Tue Dec 19 02:32:12 EST 2000


  I'm trying to embed python in a much larger project (a MUD)
as a scripting language, but I'm stuck, essentially right at
the begining.  The docs at python.org on this section seem,
ahh, incomplete (unless I'm missing something).  What I'm
trying to do ATM is something along the lines of let python
code access and modify the values of C++ objects outside of
the interpreter.  I believe the correct way to go about this
is to create a new python object type that understands how
to find the C++ objects in the C++ portion of the program,
providing it with get and set attr methods.  However, I'm
at a loss as to how to actually do this.  I found the 
PyTypeObject struct, and I see it has a lot of fields for
functions that do things, but no actual data storage, so
I don't see any way to keep track of which python object
instances points to which C++ object instances.  Can anyone
point me to any examples of how to do this, or explain it?
Or am I barking up the wrong tree entirely?

 Thanks for any and all help,
 Jp Calderone



More information about the Python-list mailing list