~/talk

Extend and Embed Python with C++

Talkat Meeting C++ 2022 · 2022-11-17..11-19· [python]
slides:none on file

Shows exact mechanics: building a PIC shared library, calling it from Python with ctypes, generating wrappers with SWIG, and writing idiomatic bindings with pybind11; demonstrates a native C extension, a SWIG-generated .py/.c wrapper, and C++ class bindings with constructors, methods, inheritance and a __repr__-style printer that actually work. Covers embedding a Python interpreter in a C program, calling Python functions and returning values, discusses GIL workarounds, build hassles and a real-world frozen-Python deployment used for automation.

AI-written summary · about

  1. 0:00Introduction
  2. 1:06Why extend and embed Python with C++
  3. 4:16Extending Python with ctypes
  4. 10:20Python extension modules in C
  5. 16:23Automating bindings with SWIG
  6. 19:53Extending Python with pybind11
  7. 22:23Key features of pybind11
  8. 32:26Embedding Python in C++
  9. 34:38Methods for embedding Python
  10. 42:27Summary and recommendations
  11. 44:15Q&A
  12. 47:25Boilerplate reduction tools
  13. 49:30Debugging interoperability
  14. 50:38Handling out parameters
  15. 53:15Support for templates in pybind11
  16. 54:38Binding non-copyable types
  17. 57:23Embedding Python interpreter
  18. 59:50Static linking and frozen Python
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.