C++ Boost

Boost.Python

Header <boost/python/exec.hpp>


Contents

Introduction
Functions
exec
exec_file

Introduction

Exposes a mechanism for embedding the python interpreter into C++ code.

Functions

exec

object exec(str code,
            object globals = object(),
            object locals = object());
    
Effects: Execute Python source code from code in the context specified by the dictionaries globals and locals.
Returns: An instance of object which holds the result of executing the code.

exec_file

object exec_file(str filename,
                 object globals = object(),
                 object locals = object());
    
Effects: Execute Python source code from the file named by filename in the context specified by the dictionaries globals and locals.
Returns: An instance of object which holds the result of executing the code.