C++ embeding API?

Gordon McMillan gmcm at hypernet.com
Wed Nov 3 12:11:01 EST 1999


Gaetan Corneau wrote:
> 
> Is anyone working on a high-level C++ embedding API?
> I would be interested in that, and could help any ongoing effort
> in that direction. I have no experience writing C++ apps with
> embedded Python (I'm just beginning to read the doc), but I am an
> experienced C++ programmer.

There are at least 2 C++ libraries for Python. cxx (from the 
LLNL download) is a very sophisticated one, my SCXX is a 
vastly simpler, less complete and lighterweight one (on my 
starship pages). There may be more - check out the C++ SIG.

In both of the above, the emphasis is on making commonly 
used PyObjects look like C++ objects.

As for "embedding" - there is no embedding API. Embedding 
varies between:
  Py_Initialize();
  PyRun_SimpleString('...');
  Py_Finalize();
to highly complex interactions where you're importing 
modules, creating instances, calling methods etc. cxx covers 
a great deal more of that, but SCXX doesn't use templates and 
most of it ends up inline.

SCXX-is-probably-also-buggier-ly y'rs

- Gordon




More information about the Python-list mailing list