|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | + |
| 3 | +<html> |
| 4 | + <head> |
| 5 | + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 6 | + <link rel="stylesheet" type="text/css" href="../boost.css"> |
| 7 | + |
| 8 | + <title>Boost.Python - <boost/python/exec.hpp></title> |
| 9 | + </head> |
| 10 | + |
| 11 | + <body> |
| 12 | + <table border="0" cellpadding="7" cellspacing="0" width="100%" summary= |
| 13 | + "header"> |
| 14 | + <tr> |
| 15 | + <td valign="top" width="300"> |
| 16 | + <h3><a href="../../../../index.htm"><img height="86" width="277" |
| 17 | + alt="C++ Boost" src="../../../../boost.png" border="0"></a></h3> |
| 18 | + </td> |
| 19 | + |
| 20 | + <td valign="top"> |
| 21 | + <h1 align="center"><a href="../index.html">Boost.Python</a></h1> |
| 22 | + |
| 23 | + <h2 align="center">Header <boost/python/exec.hpp></h2> |
| 24 | + </td> |
| 25 | + </tr> |
| 26 | + </table> |
| 27 | + <hr> |
| 28 | + |
| 29 | + <h2>Contents</h2> |
| 30 | + |
| 31 | + <dl class="page-index"> |
| 32 | + <dt><a href="#introduction">Introduction</a></dt> |
| 33 | + |
| 34 | + <dt><a href="#functions">Functions</a></dt> |
| 35 | + |
| 36 | + <dd> |
| 37 | + <dl class="page-index"> |
| 38 | + <dt><a href="#exec-spec"><code>exec</code></a></dt> |
| 39 | + <dt><a href="#exec_file-spec"><code>exec_file</code></a></dt> |
| 40 | + </dl> |
| 41 | + </dd> |
| 42 | + </dl> |
| 43 | + <hr> |
| 44 | + |
| 45 | + <h2><a name="introduction"></a>Introduction</h2> |
| 46 | + |
| 47 | + <p>Exposes a mechanism for embedding the python interpreter into C++ code.</p> |
| 48 | + |
| 49 | + <h2><a name="functions"></a>Functions</h2> |
| 50 | + |
| 51 | + <h3><a name="exec-spec"></a><code>exec</code></h3> |
| 52 | + <pre> |
| 53 | +object exec(str code, |
| 54 | + object globals = object(), |
| 55 | + object locals = object()); |
| 56 | + </pre> |
| 57 | + <dl class="function-semantics"> |
| 58 | + <dt><b>Effects:</b> |
| 59 | + Execute Python source code from <code>code</code> in the context |
| 60 | + specified by the dictionaries <code>globals</code> and <code>locals</code>. |
| 61 | + </dt> |
| 62 | + <dt><b>Returns:</b> |
| 63 | + An instance of <a href="object.html#object-spec">object</a> |
| 64 | + which holds the result of executing the code. |
| 65 | + </dt> |
| 66 | + </dl> |
| 67 | + |
| 68 | + <h3><a name="exec_file-spec"></a><code>exec_file</code></h3> |
| 69 | + <pre> |
| 70 | +object exec_file(str filename, |
| 71 | + object globals = object(), |
| 72 | + object locals = object()); |
| 73 | + </pre> |
| 74 | + <dl class="function-semantics"> |
| 75 | + <dt><b>Effects:</b> |
| 76 | + Execute Python source code from the file named by <code>filename</code> |
| 77 | + in the context specified by the dictionaries <code>globals</code> and |
| 78 | + <code>locals</code>. |
| 79 | + </dt> |
| 80 | + <dt><b>Returns:</b> |
| 81 | + An instance of <a href="object.html#object-spec">object</a> |
| 82 | + which holds the result of executing the code. |
| 83 | + </dt> |
| 84 | + </dl> |
| 85 | + |
| 86 | + </body> |
| 87 | +</html> |
| 88 | + |
0 commit comments