Path question

Scott David Daniels Scott.Daniels at Acm.Org
Wed Feb 4 00:42:21 CET 2009

Geert Vancompernolle wrote:
> I have the following path construction: ...
> ./src/
>     /
>     /modules/
>             /
>     /ui/
>        /mainwindow/
>                   /
> I want to call ... 'MainWindow' in module 'mainwindow', from 'application'.

> I'm having the following import statement in '':
> from .. ui.mainwindow.mainwindow import MainWindow

If you run the application with the command:
     python -m src.modules.application ...
rather than
     python src/modules/ ...
your import should work.
You need to make the package layering to application explicit.
Similarly, you can start Idle with:
     python -m idlelib.idle ...

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-list mailing list