Popular recipes tagged "sys_path"http://code.activestate.com/recipes/tags/sys_path/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>
A Script that Adds a Directory to sys.path Permanently (Python)
2012-02-16T23:15:11-08:00Eric Snowhttp://code.activestate.com/recipes/users/4177816/http://code.activestate.com/recipes/578043-a-script-that-adds-a-directory-to-syspath-permanen/
<p style="color: grey">
Python
recipe 578043
by <a href="/recipes/users/4177816/">Eric Snow</a>
(<a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/sys_path/">sys_path</a>).
</p>
<p>This script takes advantage of PEP 370, "Per user site-packages directory". It manages .pth files, which are are non-volatile (unlike manually adding to sys.path). See <a href="http://docs.python.org/library/site.html." rel="nofollow">http://docs.python.org/library/site.html.</a></p>