[C++-sig] Re: Converting a C++ object to python

Brett Calcott brett.calcott at paradise.net.nz
Mon Sep 15 02:09:59 CEST 2003

> int main()
> {
>    Py_Initialize();
>    PyImport_AppendInittab( "wrap", initwrap );
>    booga b;
>    object obj( &b );
> }

>From the Docs at:

(from http://www.pyzine.com/manual/api/importing.html)

int PyImport_AppendInittab(char *name, void (*initfunc)(void)):

Add a single module to the existing table of built-in modules. This is a
convenience wrapper around PyImport_ExtendInittab(), returning -1 if the
could not be extended. The new module can be imported by the name name, and
uses the function initfunc as the initialization function called on the
attempted import. This should be called before Py_Initialize().

More information about the Cplusplus-sig mailing list