pybind11
stable
  • Changelog
  • Upgrade guide

The Basics

  • Installing the library
  • 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
  • CMake helpers
pybind11
  • »
  • Python C++ interface
  • Edit on GitHub

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
    • Implicit casting
    • Handling exceptions
    • Gotchas
  • NumPy
    • Buffer protocol
    • Arrays
    • Structured types
    • Vectorizing functions
    • Direct access
    • Ellipsis
    • Memory view
  • Utilities
    • Using Python’s print function in C++
    • Capturing standard output from ostream
    • Evaluating Python expressions from strings and files
Next Previous

© Copyright 2017, Wenzel Jakob Revision f1abf5d9.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: stable
Versions
latest
stable
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds