sys path modification

neubyr neubyr at gmail.com
Mon Jul 27 13:24:34 EDT 2015


I am trying to understand sys.path working and best practices for managing
it within a program or script. Is it fine to modify sys.path using
sys.path.insert(0, EXT_MODULES_DIR)? One stackoverflow answer -
http://stackoverflow.com/a/10097543 - suggests that it may break external
3'rd party code as by convention first item of sys.path list, path[0], is
the directory containing the script that was used to invoke the Python
interpreter. So what are best practices to prepend sys.path in the program
itself? Any further elaboration would be helpful.


- thanks, N
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150727/f1eae573/attachment.html>


More information about the Python-list mailing list