Help Required for Choosing Programming Language

sturlamolden sturlamolden at yahoo.no
Mon Feb 19 06:22:20 EST 2007


On Feb 17, 1:34 am, Stef Mientki <S.Mientki-nos... at mailbox.kun.nl>
wrote:

> - designing the GUI will cost me about 2 .. 3 times as much in Python

Use a design tool like GLADE for PyGTK, wxGlade for wxPython or Komodo
for tkinter. The more of the GUI code you can remove from your
functional code the better. GUI code tends to clutter up the
functional code. Have you ever tried to make changes in an MFC
project? The optimal solutions are Microsoft's 'Avalon' and GTK/
libglade, where all GUI code are placed inside an XML resource.

The second thing is that GUIs are made very differently in Python and
traditional Windows tools like Delphi and VS.NET. Most Python toolkit
have a concept of 'layout managers' that will size and lay out the
widgets for you. In Delphi and VB you will typically drag and drop
controls on a form, and use anchors and docking and manually size the
controls. You are therefore much more dependent on graphical GUI
design in these environments. In Python toolkits, the layout manager
do all this work for you. Layout managers are also found in Java
toolkits like Swing and SWT. In order to make effective GUIs in Python
you must learn to use these, and forget about all the bad habits
Delphi thought you. Try to imagine the GUI as a tree of containers,
where the widgets reside on the leafs, instead of controls dropped on
a form. When you can do that in your head, you can make GUIs more
quickly in Python than VB or Delphi.

The main advantages to using layout managers are: GUIs are less
tedious to develop, you don't have to worry about resizing and
adapting to different screen sizes, and large projects become easier
to maintain.

















> - Python is not capable of doing everything I need
> (almost all interactive actions are very primitive and crashes a lot)
> - designing my other functional code in Python,
> will reduce the development time with an estimated factor of 2
> So the combination of Delphi (or VB) and Python seems the optimal combination for heavily GUI's.
> - one of the big problems with Python is the version differences (compatibility)
>
> In one of the other threads, Dabo was meant as a GUI designer,
> I tried it yesterday,
> and although it looks very promising,
> at the moment this is not a graphical design environment,
> just a complex (compared to Delphi) design environment with graphical feedback.
> Just my 2 cents ;-)
>
>
>
> >> (although others in this group will definitely have a different opinion),
> >> the beautiful thing about Python is,
> >> that you can easily embed /encapsulate it in VB,
> >> giving you the best of both worlds.
>
> > Why would one go thru the pain of "embedding" Python in VB (if that's
> > even possible) when Python can directly access the Win32 API and all COM
> > components and have bindings for GUI toolkits like wxWidgets ?
>
> "Pain of embedding" ?
> About 10 lines of code, which you find ready to use on the web ;-)
> And the performance is fantastic !
> (I even use it for realtime, as a complete replacement for MatLab and LabView)
>
> Bruno, I think we've a different audience / target application,
> and at the moment we'll never agree about GUI,
> but I promise that'll try the different Python graphics in the future,
> and you will be the first to hear if my current conclusions are wrong.
>
> cheers,
> Stef





More information about the Python-list mailing list