Py3: Import relative path module

Gnarlodious gnarlodious at gmail.com
Sun Oct 31 11:06:05 EDT 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

-- Gnarlie



More information about the Python-list mailing list