I have the following directory structure:
my_program/
foo.py
__init__.py # empty
conf/
config.cfg
__init__.py
In foo.py I have this:
import sys
#sys.path.append('conf/')
import ConfigParser
config = ConfigParser.ConfigParser()
config.read( 'conf/config.cfg' )
In conf/__init__.py
I have
__all__ = ["config.cfg"]
I get this error in foo.py
that I can fix by giving the full path but not when I just put conf/config.cfg
but I want the relative path to work:
ConfigParser.NoSectionError
which actually means that the file can't be loaded (so it can't read the section).
I've tried commenting/un-commenting sys.path.append('conf/')
in foo.py
but it doesn't do anything.
Any ideas?