Created
November 29, 2013 22:52
-
-
Save bmnn/7713066 to your computer and use it in GitHub Desktop.
python; import; module; path;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r# (url='http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path') | |
# \ldots The advantage of adding a path to sys.path (over using imp) is that it simplifies things when importing more than one module from a single package. For example: \ldots | |
import sys | |
# the mock-0.3.1 dir contains testcase.py, testutils.py & mock.py | |
sys.path.append('/foo/bar/mock-0.3.1') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment