test wrote: > basic noob question here. > > i am trying to reference a package, i have the structure: > > mypack/ > __init__.py > test.py > subdir1/ > __init__.py > mod1.py > subdir2/ > __init__.py > mod2.py > > can someone please tell me why the statement: > > from mypack.subdir1.mod1 import * > > does NOT work from mod2.py nor from test.py? > > instead, if i use: > > from subdir1.mod1 import * > > it works perfectly from test.py. > > ....?
The parent directory of mypack must be in the module search path, see http://docs.python.org/tut/node8.html#l2h-19 The least intrusive way to achieve this is to move test.py one level up in the directory hierarchy. Peter -- http://mail.python.org/mailman/listinfo/python-list