I am having difficulties importing a script from a directory that is not stored in sys.path. I have a script saved as test.py in a directory called "Development" and am trying to add the development directory to sys.path so I can import a function from my current script called index.py.
Here is my code for index.py:
import sys
sys.path.append ('/Users/master/Documents/Development/')
import test
printline()
printline() is defined in test.py as:
def printline():
print "I am working"
Here is the error I am receiving:
Traceback (most recent call last):
File "/Users/master/Documents/index.py", line 6, in <module>
printline()
NameError: name 'printline' is not defined
Any ideas on how I can get this to work?
Thanks.