Popular recipes by Jesse Noller http://code.activestate.com/recipes/users/2519072/2005-07-15T13:15:48-07:00ActiveState Code RecipesImport Modules/Discover methods from a directory name (Python)
2005-07-15T13:15:48-07:00Jesse Nollerhttp://code.activestate.com/recipes/users/2519072/http://code.activestate.com/recipes/436873-import-modulesdiscover-methods-from-a-directory-na/
<p style="color: grey">
Python
recipe 436873
by <a href="/recipes/users/2519072/">Jesse Noller</a>
(<a href="/recipes/tags/extending/">extending</a>).
Revision 2.
</p>
<p>For something I am working on, I needed the ability to scan a supplied directory, adding the directory to the sys.path within Python, and then blanket import the modules within that directory. Following that, I had to filter any builtin or special methods within those modules and return a list of the methods for the module I had imported.</p>
<p>The script is very simplistic in what it does.</p>