How do you append directories to your Python path?
Your path (i.e. the list of directories Python goes through to
search for modules and files) is stored in the
attribute of the
sys module. Since
is a list, you can use the
append method to add
new directories to the path.
For instance, to add the directory
the path, just do:
Advertisement: In 2012, I published the book A Hands-On Introduction to Using Python in the Atmospheric and Oceanic Sciences. If you're new to Python, you may find it useful!