question about module resolution

Emin emin.shopper at gmail.com
Wed Jan 17 17:08:53 CET 2007


Dear Experts,

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




More information about the Python-list mailing list