title: Is it possible to list all functions in a module?
body: <p>I defined a .py file in this format:</p>
  
  <h3>foo.py</h3>
  
  <pre><code>def foo1(): pass
  def foo2(): pass
  def foo3(): pass
  </code></pre>
  
  <p>I import it from another file:</p>
  
  <h3>main.py</h3>
  
  <pre><code>from foo import * 
  # or
  import foo
  </code></pre>
  
  <p>Is it possible list all functions name, e.g. <code>["foo1", "foo2", "foo3"]</code>?</p>
  
  <hr>
  
  <p>Thanks for your help, I made a class for what I want, pls comment if you have suggestion</p>
  
  <pre><code>class GetFuncViaStr(object):
      def __init__(self):
          d = {}
          import foo
          for y in [getattr(foo, x) for x in dir(foo)]:
              if callable(y):
                 d[y.__name__] = y
      def __getattr__(self, val) :
          if not val in self.d :
             raise NotImplementedError
          else:
             return d[val] 
  </code></pre>