Py_cpp is a system for quickly and easily interfacing C++ code with Python such that the Python interface is very similar to the C++ interface. It is designed to be minimally intrusive on your C++ design. In most cases, you should not have to alter your C++ classes in any way in order to use them with py_cpp. The system should simply "reflect" your C++ classes and functions into Python.
The source code for py_cpp, including a MSVC demo project is available here: py_cpp.tgz. It has been tested with GCC 2.95.2 with the STLport standard library implementation, and with Microsoft Visual C++ 6 sp3 using both STLport and the library implementation that ships with the compiler. I think it will also works with an upcoming release of Metrowerks CodeWarrior. Py_cpp requires the Boost libraries, and may become part of the boost installation someday.
More sophisticated examples, including examples of how to make extension classes with
overridable virtual functions, are given in extclass_demo.cpp
,
extclass_demo.h
, and test_extclass.py
in the source code archive. There's much more here, and much more
documentation to come...
© Copyright David Abrahams 2000. Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.