I have to append sys.path in order for one of my scripts to work. As I will be doing this often, I was considering permanently adding the path.
Is this generally considered safe?
Also, if my main script appends sys.path, do I need to do so for every module used in that script, or are the changes global?
Thanks!
If you find yourself commonly adding elements to
sys.path, adding them permanently can be a good idea. However you should not do this by editingsys.pathdirectly, it is best accomplished by setting the PYTHONPATH environment variable.There is some documentation on how to set PYTHONPATH on Windows, and this article has some good information for setting environment variables on Linux.