title: Python - Import all files in a directory tree
body: <p>I want to import all python files in a directory tree, i.e. if we have the following directory structure:</p>
  
  <pre><code>tests/
  tests/foo.py
  tests/subtests/bar.py
  </code></pre>
  
  <p>(Imagine that the tree is of arbitrary depth).</p>
  
  <p>I would like to do <code>import_all('tests')</code> and load <code>foo.py</code> and <code>bar.py</code>. Importing with the usual modules names (<code>tests.foo</code> and <code>tests.subtests.bar</code>) would be nice, but is not required.</p>
  
  <p>My actual use case is that I have a whole bunch of code containing django forms; I want to identify which forms use a particular field class. My plan for the above code is to load all of my code, and then examine all loaded classes to find form classes.</p>
  
  <p>What's a nice, simple way to go about this in python 2.7?</p>