[C++-sig] Injecting python derived C++ types at runtime in embedded environment

Ingo Luetkebohle ingo at fargonauten.de
Sat Jul 10 00:17:41 CEST 2004

Am Sa, den 10.07.2004 schrieb Brian Hall um 0:01:
> Should I expose the types using the BOOST_PYTHON_MODULE macro? Or can I expose 
> them after PyInitialize directly into the __main__ namespace?  Is it possible 
> to reevaluate the code and have it update the derived class or will I have to 
> purge the globals in some fashion?

Boost.Python helps you a lot with making the C++ types available to
Python at all.  The results is a module that you can import.

After having created the module,  you have to make it available to the
python script.  Just use a normal import statement, that will work as
usual.  If the user provides the python script, you can prepend the
statement the top, before compiling it.  



Soll doch jeder bleiben, wie er gerne wäre.

More information about the Cplusplus-sig mailing list