#include <embed.h>
Public Member Functions | |
scoped_interpreter & | operator= (const scoped_interpreter &)=delete |
scoped_interpreter & | operator= (scoped_interpreter &&)=delete |
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_interpreter () | |
Private Attributes | |
bool | is_valid = true |
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
|
inlineexplicit |
|
delete |
|
inlinenoexcept |
|
delete |
|
delete |