Python C++ Integration with Boost.Python


Python and C++ are popular languages that complement each other well: Python is high-level and productive while C++ runs close to the metal and requires significant expertise to use correctly. Boost.Python is a C++ library that allows you to safely and intuitively combine these languages to get the best of both. This course will teach you the fundamentals of integrating Python with C++ using Boost.Python, along with patterns for making your integrations efficient and idiomatic.


  • Reviewing the essentials of the CPython runtime
  • Understanding the concepts of extending and embedding Python
  • Exploring the central roles of boost::python::object and handle
  • Constructing and calling Python objects in C++
  • Accessing Python object attributes in C++
  • Writing functions in C++ and calling them from Python
  • Creating Python classes and modules in C++
  • Exploring constructors, properties, and data members
  • Translating and handling exceptions between Python and C++
  • Constructing Python objects from C++ objects
  • Extracting C++ objects from Python objects
Course requirements
Students will need to bring their own laptops with a C++ compiler, a recent version of Boost (and esp. Boost.Python), a Python 3 installation with development headers, an editor, and a build system (e.g. make or VS).


09:00 - 17:00