![]() |
Scarab
v2.9.1
Project 8 C++ Utility Library
|

Go to the source code of this file.
Classes | |
| struct | embedded_module |
Python 2.7/3.x compatible version of PyImport_AppendInittab and error checks. More... | |
| class | scoped_interpreter |
Namespaces | |
| pybind11 | |
| glibc defines I as a macro which breaks things, e.g., boost template names | |
| pybind11::detail | |
Macros | |
| #define | PYBIND11_EMBEDDED_MODULE_IMPL(name) |
| #define | PYBIND11_EMBEDDED_MODULE(name, variable) |
Functions | |
| void | initialize_interpreter (bool init_signal_handlers=true) |
| void | finalize_interpreter () |
| #define PYBIND11_EMBEDDED_MODULE | ( | name, | |
| variable | |||
| ) |
Add a new module to the table of builtins for the interpreter. Must be defined in global scope. The first macro parameter is the name of the module (without quotes). The second parameter is the variable which will be used as the interface to add functions and classes to the module.
.. code-block:: cpp
PYBIND11_EMBEDDED_MODULE(example, m) {
... initialize functions and classes here m.def("foo", []() { return "Hello, World!"; }); }
1.8.13