how to absolute import?

Qiangning Hong hongqn at gmail.com
Thu Mar 10 21:14:00 EST 2005


>From Guido's PEP8:

      - Relative imports for intra-package imports are highly
      discouraged.  Always use the absolute package path for all
      imports.

Does it mean I should put my develop directory into PYTHONPATH (e.g.
/home/hongqn/devel/python) and use "import myproj1.package1.module1 as
module1" all the way?  Or should I make a "./setup.py install" for
every package whenever I made a change?

I'm using python 2.3 so from .foo import bar doesn't work for me.




More information about the Python-list mailing list