Emin wrote: > I often find myself wanting to have a child module get some parameters > defined in a parent module. For example, imagine I have the following > directory structure and want something in baz.py to look at a value in > config.py. I end up putting in things like import sys; > sys.path.append('../..'). Is there a better way? > > foo/ > __init__.py > config.py > bar/ > __init__.py > baz.py
from __future__ import absolute_import from .. import config Peter -- http://mail.python.org/mailman/listinfo/python-list