title: Python - if given file name using inspect to get list of methods in file
body: <p>I have a list of python files.  I need to get all methods e.g. functions using inpect</p>
  
  <pre><code>E.g. mylist = ['/path/to/myfle.py']
  
     /path/to/myfle.py
      def foo():
         return 'bar'
      def bar():
         return 'foo'
  </code></pre>
  
  <p>How do I get the list of methods if given a file name and path?</p>
  
  <pre><code>for file in mylist:
      ????
  
  
  
  #The file exists
  ls /home/ubuntu/workspace/ndkt-scraper/src/parsers/pacer/parser_pacer_file.py
  /home/ubuntu/workspace/ndkt-scraper/src/parsers/pacer/parser_pacer_file.py
  
  strs = '/home/ubuntu/workspace/ndkt-scraper/src/parsers/pacer/parser_pacer_file.py'
  path, _ = os.path.splitext(strs)               #now path is '/path/to/myfile'
  file_name = path.split('/')[-1]                # returns myfile]
  mod = importlib.import_module(file_name, path)
  
  Traceback (most recent call last):
    File "/home/ubuntu/workspace/ndkt-scraper/src/crawler.py", line 31, in &lt;module&gt;
      mod = importlib.import_module(file_name, path)
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
      __import__(name)
  ImportError: No module named parser_pacer_file
  
  
  parser_pacer_file.py
  def parser_pacer_method(html):
  
      data = {'foo':'bar'}
  
      return data
  </code></pre>