擅长:python、mysql、java
<p>使用<code>globals()</code>和<code>types.FunctionType</code></p>
<pre><code>>>> from types import FunctionType
>>> functions = [x for x in globals().values() if isinstance( x, FunctionType)]
</code></pre>
<p>演示:</p>
<pre><code>from types import FunctionType
def func():pass
print [x for x in globals().values() if isinstance(x, FunctionType)]
#[<function func at 0xb74d795c>]
#to return just name
print [x for x in globals().keys() if isinstance(globals()[x], FunctionType)]
#['func']
</code></pre>