[Tutor] Adding a GUI
Michael Langford
mlangford.cs03 at gtalumni.org
Sun Sep 16 16:22:59 CEST 2007
Wormwood, an easier way to create a crossplatform GUI than raw wxPython is
to use pythoncard, which is a library that is on top of wxPython that is
there to make it easier to use and to make it easier to layout GUI
screens/dialogs.
I've found its a much faster "whiteboard to running software time" then
wxPython by itself. (I've used both, raw wxPython a lot *more* than
pythoncard, as i'd not yet heard of it).
Alan is right about separating the core logic of the program from the
input/output methods, and using that in both a command line and a gui
program.
I doubt you'll need a book to use pythoncard. Its about as easy as VB to
build a form with the WYSIWYG, and very pythonic to use the forms you've
built.
To get up an going, install a compatible version of wxPython use this link:
http://pythoncard.sourceforge.net/walkthrough1.html
--Michael
References:
Pythoncard:http://pythoncard.sourceforge.net/
On 9/16/07, wormwood_3 <wormwood_3 at yahoo.com> wrote:
>
> Hi all,
>
> I am just starting to learn GUI programming, with wxPython. I have a
> script that that I have developed to a useful point, and I want to add a GUI
> to it. I am a little unsure as the the best approach to this. The script
> heretofore was just run at the command line. Would it make sense to add an
> option in the same script to have it run in "graphical mode", which would
> trigger the wxPython code I would add in, and otherwise use the same logic?
>
> More generally: Anyone have any tips on adding a GUI to a pre-existing
> script in a way that minimizes repetition of logic? I would rather not make
> a separate script that only used wxPython, and I do not think I have to, but
> perhaps there are good reasons to, etc.
>
> Thanks,
> Sam
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
Michael Langford
Phone: 404-386-0495
Consulting: http://www.TierOneDesign.com/
Entertaining: http://www.ThisIsYourCruiseDirectorSpeaking.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070916/f8f57b13/attachment.htm
More information about the Tutor
mailing list