Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'python,': 0.02; 'true,': 0.05; 'cc:addr:python-list': 0.11; 'gui': 0.12; 'cleaner': 0.16; 'domains.': 0.16; 'investigate': 0.16; 'obviously,': 0.16; 'subject:GUI': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'do.': 0.18; 'basically': 0.19; 'cc:addr:python.org': 0.22; 'this?': 0.23; 'header:User-Agent:1': 0.23; 'driven': 0.24; 'regardless': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'developing': 0.27; 'header:In-Reply-To:1': 0.27; 'wondering': 0.29; "i'm": 0.30; 'that.': 0.31; 'allows': 0.31; 'development.': 0.33; 'problem': 0.35; 'advice': 0.35; 'test': 0.35; 'but': 0.35; 'doing': 0.36; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'should': 0.36; 'application': 0.37; 'two': 0.37; 'problems': 0.38; 'how': 0.40; "you've": 0.63; 'email addr:gmail.com': 0.63; 'information': 0.63; 'such': 0.63; 'to:addr:gmail.com': 0.65; 'side': 0.67; 'jul': 0.74; 'behavior': 0.77; 'strategies': 0.77; 'given.': 0.84; '2013,': 0.91 Date: Sat, 13 Jul 2013 14:03:24 -0500 (CDT) From: Wayne Werner X-X-Sender: wayne@gilgamesh To: fronagzen@gmail.com Subject: Re: Ideal way to separate GUI and logic? In-Reply-To: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373742210 news.xs4all.nl 15992 [2001:888:2000:d::a6]:39933 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50612 On Sat, 13 Jul 2013, fronagzen@gmail.com wrote: > Well, I'm a newcome to Python, but I'm developing a program with a GUI in tkinter, and I'm wondering what is the best, 'most pythonic' way of doing this? > > I could, obviously, write a monolithic block of code. True, you could, but don't do that. You should investigate strategies like model view presenter, and test or behavior driven development. My recommendation echos the other advice you've been given. Basically you think of your application in terms of two problems or domains. One is the what that you want no do. What information do you need? The other problem is how do you get that information from the user and retun to them information than they need? Regardless of which side you have driving, UI or Presenter, having a design such as this allows for much cleaner code. HTH -W