Most viewed Python recipes tagged "meta:requires=runpy"http://code.activestate.com/recipes/langs/python/tags/meta:requires=runpy/views/2011-07-15T04:13:59-07:00ActiveState Code RecipesCreate module directly from a filesystem path (Python)
2011-07-15T04:13:59-07:00Nick Coghlanhttp://code.activestate.com/recipes/users/2035254/http://code.activestate.com/recipes/577792-create-module-directly-from-a-filesystem-path/
<p style="color: grey">
Python
recipe 577792
by <a href="/recipes/users/2035254/">Nick Coghlan</a>
.
</p>
<p>Given a filesystem path, use it to create a valid Python module. Based on <code>runpy.run_path()</code>, so accepts Python source files, compiled Python files and directories and zipfiles containing __main__.py files as valid targets.</p>