BoB robotics
The Brains on Board robotics library
pybind11::scoped_interpreter Class Reference

#include <embed.h>

Public Member Functions

 scoped_interpreter (bool init_signal_handlers=true, int argc=0, const char *const *argv=nullptr, bool add_program_dir_to_path=true)
 
 scoped_interpreter (const scoped_interpreter &)=delete
 
 scoped_interpreter (scoped_interpreter &&other) noexcept
 
scoped_interpreteroperator= (const scoped_interpreter &)=delete
 
scoped_interpreteroperator= (scoped_interpreter &&)=delete
 

Detailed Description

\rst Scope guard version of initialize_interpreter and finalize_interpreter. This a move-only guard and only a single instance can exist.

See initialize_interpreter for a discussion of its constructor arguments.

.. code-block:: cpp

#include <pybind11/embed.h>

int main() {
    py::scoped_interpreter guard{};
    py::print(Hello, World!);
} // <-- interpreter shutdown

\endrst


The documentation for this class was generated from the following file: