Tkinter app structure

Richard Lewis richardlewis at fastmail.co.uk
Mon Jun 13 19:04:30 CEST 2005


On Mon, 13 Jun 2005 16:45:11 +0100, "Richard Lewis"
<richardlewis at fastmail.co.uk> said:
> 
> Whats going wrong? Is it a 'circular import'? Is there a better way that
> I could organise these modules?
> 
I've got a hack which I'm not happy with:

I've got rid of the main.py module and put its code into the same module
as the MainWindow class is defined in. I don't like this because I want
to be able to have a top level module which creates a user interface
object (from a class which lives somewhere else) and a data object (from
a class which lives somewhere else) and begins the event loop all in a
very transparent and easy to read way. As it is now, the entry level
code is tucked away at the bottom of a large user interface defining
class and doesn't logically belong there.

Richard :-(



More information about the Python-list mailing list