|
Boost.PythonHeader <boost/python/import.hpp> |
import
Exposes a mechanism for importing python modules.
import
object import(str name);
name
.#include <iostream> #include <string> using namespace boost::python; void print_python_version() { // Load the sys module. object sys = import("sys"); // Extract the python version. std::string version = extract<std::string>(sys.attr("version")); std::cout << version << std::endl; }
Revised 01 November, 2005
© Copyright Stefan Seefeld 2005.