Popular recipes tagged "sys_path" but not "script"http://code.activestate.com/recipes/tags/sys_path-script/2012-04-06T16:06:17-07:00ActiveState Code RecipesQuickly add all dirs to sys.path if dir has .py file (Python)
2012-04-06T16:06:17-07:00Andrew Yurisichhttp://code.activestate.com/recipes/users/4180867/http://code.activestate.com/recipes/578097-quickly-add-all-dirs-to-syspath-if-dir-has-py-file/
<p style="color: grey">
Python
recipe 578097
by <a href="/recipes/users/4180867/">Andrew Yurisich</a>
(<a href="/recipes/tags/add/">add</a>, <a href="/recipes/tags/os_walk/">os_walk</a>, <a href="/recipes/tags/sys_path/">sys_path</a>).
Revision 2.
</p>
<p>Add all dirs under <code>folder</code> to sys.path if any .py files are found.
Use an abspath if you'd rather do it that way.</p>
<p>Uses the current working directory as the location of using.py.
Keep in mind that os.walk goes <em>all the way</em> down the directory tree.</p>