$ python2.4
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import TTAMachine
>>> b = TTAMachine.Bus("b1", 32, 16, TTAMachine.Machine.Extension.ZERO)
>>> b
<TTAMachine.Bus object at 0xb7da2a54>
>>> m = TTAMachine.Machine()
>>> m
<TTAMachine.Machine object at 0xb7da2a7c>
>>> m.addBus(b)
You need to set PYTHONPATH to include the directory where the loadable
modules are, and you also need to set LD_LIBRARY_PATH appropriately so
that the TCE libraries referenced by the bindings can be found. The
Python modules only provide the glue between C++ and Python.
When a C++ function returns a pointer, Boost.Python needs to know whether it should take care of the pointer or not. This is something that cannot be inferred from a function signature, so it needs to be explicitly stated by the programmer using a call policy, as explained in the tutorial. The two more common policies are return_internal_reference and return_value_policy<manage_new_object>.
If a C++ function (e.g. a member function) is passed a raw pointer, and the function takes ownership of the pointer, Python needs to be informed about the ownership transfer. This can be done using an auto_ptr, see the Boost.Python FAQ for details.