Refactoring question
Steve Holden
steve at holdenweb.com
Wed Apr 4 10:48:42 EDT 2007
kyosohma at gmail.com wrote:
> On Apr 3, 11:41 pm, "ginstrom" <ginst... at tree.odn.ne.jp> wrote:
>>> On Behalf Of Kevin Walzer
>>> What's the best way to do this? Can anyone point me in the
>>> right direction? How could, for instance, the top snippet be
>>> rewritten to separate the Tkinter parts from the generic stuff?
>> I like to use the broadcaster/broker recipe athttp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81983
[lots of code that was pretty irrelevant to the reply]
>
> I usually put all my GUI code into their own methods(s) and call those
> methods from the __init__(). I do the same with the logic (where
> applicable). This makes the code easier to manipulate and/or import.
>
> In wxPython, you can also use XRC to define most of the common
> elements of you GUI. I've found this method to be very helpful in
> keeping my code short and easy to read, for GUI code.
>
While talking about keeping things short and easy to read, maybe you
could be a bit more considerate in your quoting practices. We really
didn't need to see all the code quoted to hear what you had to say ...
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Recent Ramblings http://holdenweb.blogspot.com
More information about the Python-list
mailing list