Toggle navigation sidebar
Toggle in-page Table of Contents
pybind11 文档
Changelog
Upgrade guide
基础
安装库
第一步
面向对象的编码
构建系统
高级主题
Functions
Classes
Exceptions
Smart pointers
Type conversions
Overview
Strings, bytes and Unicode conversions
STL containers
Functional
Chrono
Eigen
Custom type casters
Python C++ 接口
Python 类型
NumPy
Utilities
Embedding the interpreter
Miscellaneous
额外信息
Frequently asked questions
Benchmark
Limitations
Reference
CMake helpers
.rst
.pdf
Python C++ 接口
Python C++ 接口
#
pybind11 使用薄 C++ 包装器公开 Python 类型和函数,这使得从 C++ 调用 Python 代码成为可能,而无需求助于 Python 的 C API。
Python 类型
可用的包装器
Instantiating compound Python types from C++
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
数组
结构化类型
向量化函数
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