Differences between revisions 2 and 28 (spanning 26 versions)
Revision 2 as of 2002-09-25 19:13:29
Size: 1215
Editor: MikeRovner
Comment:
Revision 28 as of 2004-05-20 23:24:30
Size: 2503
Editor: 198
Comment: +introduction
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The Boost Python Library allows the use of C/C++ from Python. It is part of the larger boost package (http://www.boost.org). The BoostPython Library binds C++ and Python in a mostly-seamless fashion. It is just one member of the boost C++ library collection at http://www.boost.org.
Line 3: Line 3:
Use the Boost Python Library to quickly and easily export a C++ library to 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 Boost.Python. The system should simply ''reflect'' your C++ classes and functions into Python. Use the BoostPython Library to quickly and easily export C++ to 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 Boost.Python. The system should simply ''reflect'' your C++ classes and functions into Python. Boost.Python bindings are written in pure C++, using no tools other than your editor and your C++ compiler.
Line 5: Line 5:
A summary of the development goals is available on the Python [http://www.python.org/sigs/c++-sig/ C++-sig] page, which also serves as a mailing list for users of both versions of the library. A preview of the v2 documentation is available [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/libs/python/doc/v2/index.html?rev=HEAD&content-type=text/html here], and instructions for getting started with a prerelease are available upon request. The Python [http://www.python.org/sigs/c++-sig/ C++-sig] serves as a mailing list for users of the library. Documentation for the current release is available at http://www.boost.org/libs/python/. Development documentation, which is usually more up-to-date, is available through the [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/libs/python/doc/index.html Boost CVSWeb] interface.
Line 7: Line 7:
More on http://www.boost.org/libs/python/doc/index.html This page serves as a forum to gather peoples' experience and as a
cookbook, as it is more dynamic by nature and open to contributors.
Line 9: Line 10:
While v2 is being developed, this page seems like a good place to assemble v2 intro and tutorial. Various items:
 * /Introduction
 * ["/FAQ"]
 * /HowTo
 * /BuildingExtensions
 * ["/module"] level: def,scope
 * ["/class"]
 * ["/extract"]
 * ["/object"]
 * ["/list"]
 * ["/iterator"]
 * /CallPolicy
 * /RuntimeErrors
Line 11: Line 24:
Tutorial:
 1. /SimpleExample
 1. /ExportingClasses
 1. /OverridableVirtualFunctions
 1. /FunctionOverloading
 1. ["/Inheritance"]
 1. /SpecialMethods
 1. /PeekUnderTheHood
 1. /CrossExtensionModuleDependencies
 1. /WrappingEnums
 1. /PointersAndSmartPointers
 1. /InternalDataStructures
Line 12: Line 37:
* ["boost.python/list"]
* ["boost.python/FAQ"]
Test cases:
 * /StlContainers

----
From DavidAbrahams:

Boost.Python is designed with the idea in mind that users never touch a Py``Object*.

Boost.Python depends on quite a few of the other boost libraries (possibly a few others):
 * type_traits
 * bind
 * function
 * mpl
 * smart_ptr

IIUC, ["weave"] can be used for embedding nontrivial C++ code, if you're
willing to stick it all inside one function body. Furthermore, tools like
weave.blitz() can make an enormous difference by compiling an entire C++
expression template corresponding to an arbitrarily complicated Python
expression. Surely that's nontrivial. It's definitely ''cool''. I think weave
offers enormous power to the person who's programming mostly in Python.

The BoostPython Library binds C++ and Python in a mostly-seamless fashion. It is just one member of the boost C++ library collection at http://www.boost.org.

Use the BoostPython Library to quickly and easily export C++ to 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 Boost.Python. The system should simply reflect your C++ classes and functions into Python. Boost.Python bindings are written in pure C++, using no tools other than your editor and your C++ compiler.

The Python [http://www.python.org/sigs/c++-sig/ C++-sig] serves as a mailing list for users of the library. Documentation for the current release is available at http://www.boost.org/libs/python/. Development documentation, which is usually more up-to-date, is available through the [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/libs/python/doc/index.html Boost CVSWeb] interface.

This page serves as a forum to gather peoples' experience and as a cookbook, as it is more dynamic by nature and open to contributors.

Various items:

Tutorial:

  1. /SimpleExample

  2. /ExportingClasses

  3. /OverridableVirtualFunctions

  4. /FunctionOverloading

  5. ["/Inheritance"]
  6. /SpecialMethods

  7. /PeekUnderTheHood

  8. /CrossExtensionModuleDependencies

  9. /WrappingEnums

  10. /PointersAndSmartPointers

  11. /InternalDataStructures

Test cases:


From DavidAbrahams:

Boost.Python is designed with the idea in mind that users never touch a PyObject*.

Boost.Python depends on quite a few of the other boost libraries (possibly a few others):

  • type_traits
  • bind
  • function
  • mpl
  • smart_ptr

IIUC, ["weave"] can be used for embedding nontrivial C++ code, if you're willing to stick it all inside one function body. Furthermore, tools like weave.blitz() can make an enormous difference by compiling an entire C++ expression template corresponding to an arbitrarily complicated Python expression. Surely that's nontrivial. It's definitely cool. I think weave offers enormous power to the person who's programming mostly in Python.

boost.python (last edited 2008-11-15 14:00:11 by localhost)

Unable to edit the page? See the FrontPage for instructions.