擅长:python、mysql、java
<p>你具体不明白什么?文档说明它将:</p>
<blockquote>
<p>Compile the source into a code or AST object. Code objects can be executed by an <a href="http://docs.python.org/2.7/reference/simple_stmts.html#exec"><code>exec</code></a> statement or evaluated by a call to <a href="http://docs.python.org/2.7/library/functions.html#eval"><code>eval()</code></a>. source can either be a Unicode string, a Latin-1 encoded string or an AST object. Refer to the <a href="http://docs.python.org/2.7/library/ast.html#module-ast"><code>ast</code></a> module documentation for information on how to work with AST objects.</p>
</blockquote>
<p>所以它需要python代码,然后返回</p>
<ul>
<li><code>exec</code>将执行python代码</li>
<li><code>eval</code>将计算一个比<code>exec</code>功能更少的表达式</li>
<li><code>ast</code>允许您导航代码生成的<a href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">Abstract Syntax Tree</a></li>
</ul>