Matthew Wilson wrote:
I want to have .foo directory that contains some python code.  I can't
figure out how to import code from that .foo directory.  Is this even
possible?

TIA

Matt
--
http://mail.python.org/mailman/listinfo/python-list
Python starts up with a list of directories to search when importing. You can append your directory to that list, and then import as you wish.

import sys
sys.path.append('/...path-to.../.foo')
import someModule  # would find and import .foo/someModule.py

You may also enjoy printing the contents of sys.path to see the list of directories Python starts with.

Gary Herron

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to