Path question

Geert Vancompernolle geert.discussions at
Tue Feb 3 19:47:29 CET 2009


I have the following path construction:


Now I want to call the method 'MainWindow' in the module 'mainwindow', 
from the module 'application'.

I'm having the following import statement in '':

from .. ui.mainwindow.mainwindow import MainWindow

That doesn't work.  I've also tried many other combinations like from 
..ui.mainwindow...  but none of them work.

I always get the following error:

"Attempted relative import beyond toplevel package"

How can I import the method 'MainWindow' from 'mainwindow' into 
'application', using the explicit relative import rules?

Or is there a better way to do this?
Best rgds,


*Use EcoCho <>: environmentally friendly search the 

More information about the Python-list mailing list