Seeking advice on GUI code architecture

John Roth newsgroups at
Mon Mar 15 16:52:30 CET 2004

"Qp" <qp at> wrote in message
news:Zp95c.6130$CI3.3590 at
> Hi, I've got a generic coding architecture question about an application
> developing.  Given that I've never developed anything quite like this
> (especially not in Python), I'd appreciate any pointers that you can give
> me.
> The app is a network client written using Twisted and Tkinter.  The
> will connect to a server, communicate via public & private chat, and also
> play simple games.
> My problem is this:  how do you keep your GUI code seperate from as much
> underlying code as possible?  As I begin, I find myself adding a lot of
> intermediate code (not Tkinter, but not Twisted either) to the GUI class,
> and it's beginning to clutter things up.  It really seems as if I should
> have a GUI class, a network class, and some separate way of communicating
> between them... but I can't seem to visualize the structure in my mind.
> If anyone has tips, docs, or examples, I would greatly appreciate it.

The suggestions about MVC and Facade patterns are right on.
One thing that will help *a lot* is to provide a second UI for
your program. Make it text based for testing. That will force you
to factor out common behavior.

John Roth

> Thanks a lot.

More information about the Python-list mailing list