pybind11
2.4
  • About this project
  • Changelog
  • Upgrade guide

The Basics

  • First steps
  • Object-oriented code
  • Build systems

Advanced Topics

  • Functions
  • Classes
  • Exceptions
  • Smart pointers
  • Type conversions
  • Python C++ interface
    • Python types
    • NumPy
    • Utilities
  • Embedding the interpreter
  • Miscellaneous

Extra Information

  • Frequently asked questions
  • Benchmark
  • Limitations
  • Reference
pybind11
  • Docs »
  • Python C++ interface
  • View page source

Python C++ interface¶

pybind11 exposes Python types and functions using thin C++ wrappers, which makes it possible to conveniently call Python code from C++ without resorting to Python’s C API.

  • Python types
    • Available wrappers
    • Casting back and forth
    • Accessing Python libraries from C++
    • Calling Python functions
    • Calling Python methods
    • Keyword arguments
    • Unpacking arguments
  • NumPy
    • Buffer protocol
    • Arrays
    • Structured types
    • Vectorizing functions
    • Direct access
    • Ellipsis
  • Utilities
    • Using Python’s print function in C++
    • Capturing standard output from ostream
    • Evaluating Python expressions from strings and files
Next Previous

© Copyright 2019, Wenzel Jakob

Built with Sphinx using a theme provided by Read the Docs.