Making embedding dynamic

John Burkhardt johnb_nospam at gamefx.com
Tue Sep 28 10:00:12 EDT 1999


Has anyone ever tried to embed python and make interfaces to a module be
more dynamic?

What I am envisioning is a way to add functions to a module after its been
initialized.  Ok, that's straightforward enough.  But the trick is also to
make it more well behaved in a c++ program.  Here is what I would like to
do:
Create an instance of some arbitrary c++ class.  Install a method into a
python module that can call a member function of my class.  Remove the
method when the c++ goes away.

I created something like this for a program without python in a much simpler
interface.  basically I have a command interpreter and a simple command
syntax.  Clients can install new commands which bind a class and a member
function of that class and then call it with something similar to a python
tuple.  Now I'm thinking of a way to upgrade this nice system to Python.

Am I being to vague here?  Anyone tried anything like this?






More information about the Python-list mailing list