ImportError depending on the calling module

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Sep 6 11:44:42 EDT 2007


On 6 sep, 08:47, Samuel <knipk... at gmail.com> wrote:

> Given the following directory structure:
>
> ---------
> |-- Obj.py
> |-- __init__.py
> |-- foo
> |   |-- FooTest.py
> |   `-- __init__.py
> `-- start1.py
> ---------

The container looks like a package (you didn't tell us the name).
Should be placed somewhere accessible thru sys.path
start1.py does NOT belong to the package, neither start2.py; place
them somewhere else. They should import the package as any other
client code, without doing any import tricks nor playing with
sys.path.

--
Gabriel Genellina




More information about the Python-list mailing list