Project layout / Import files from different subdirectories

Jeremiah Dodds jeremiah.dodds at gmail.com
Tue Nov 11 07:25:42 EST 2008


On Tue, Nov 11, 2008 at 7:08 AM, Markus Mayer <code at organisati.on> wrote:

> Steve Holden schrieb:
> > If you want shorter names in your main code, of course, you can use
> >
> > import project.main as main
> > import project.gui.mainwindow as window
> >
> > or somethihg similar.
> >
> > regards
> >  Steve
>
>

Are explicit relative imports applicable here? Could he do a

    from .. import project.main as main

without adding another __init__.py?

Or do I have my head screwed on funny?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081111/252025b7/attachment.html>


More information about the Python-list mailing list