Py3: Import relative path module

Дамјан Георгиевски gdamjan at
Sun Oct 31 18:09:42 CET 2010

> I am loathe to duplicate programming in files that should just load a
> copy from a module. I tried all kinds of tricks to import a module
> from one level up. What's the secret?
> It works if I say:
> from Data import DumpHT
> but ONLY if the search path in sys.path. I want a relative path import
> independent from  sys.path.
> How to? This is Python 3.1.1

from .. import Data.DumpHT as DumpHT

дамјан ((( )))

Hi! I'm a .signature virus! copy me into your .signature file to help me 

More information about the Python-list mailing list