擅长:python、mysql、java
<p>事实证明,<code>trace</code>对这个用例有内置的支持。<code>trace.Trace().runfunc(funcObject, *args)</code>正是这样做的。在</p>
<p>来自<a href="http://docs.python.org/2/library/trace.html#trace.Trace.runfunc" rel="nofollow">the docs</a>:</p>
<pre><code>runfunc(func, *args, **kwds)
Call func with the given arguments under control of the Trace object with the current tracing parameters.
</code></pre>