newbie embedding questions

Jason Maskell backov at nospam.csolve.net
Thu Jan 6 15:30:08 EST 2000


Well, I've finally gotten around to embedding Python in an app, after
thinking what a cool language it was for a couple years now. ;> However, I
have some stupid C++ programmer questions...

The main app is essentially a skeleton, that will be driven by Python
scripts.. It does however hold a bunch of C++ objects that it owns and
instantiates and that the Python scripts need access to. So basically I need
"glue" code to make sure the Python stuff has access to those instances'
methods, and to set callbacks in the python code for generated events. The
glue code itself is not too challenging to write (just going to have to read
the Python reference some more) but I'm a little confused as to how it
should be implemented. I can write a .c "spammodule" or whatever and have it
include the main programs .h and thus it's objects, but will that work? The
import command seems to want an .o file or something... Basically I'm a bit
confused at this point. Is there some way I can set up the glue code without
having a .o import module? The docs don't go too indepth on embedding.

Any help would be greatly appreciated.

Cheers,
Jason






More information about the Python-list mailing list