“Developing the Graphical User Interface (GUI) for a Python application is often a tedious, time-consuming, and opaque process. This is the exact opposite of how Python programmers would describe most other aspects of software development using Python. So what is it about GUI applications that causes them to be so hard?” Read the technical article at OnLamp. Two more Python articles can be found at developerWorks at IBM, here and here.
Building GUI Applications with Python
Submitted by Debinay 2002-07-19 General Development 11 Comments
I think Python is another example of the general case, where you try to do GUI programming with a scripting language and if you don’t have a good supporting framework, you end up with a lot of grief.
It takes a lot of careful thought, design, and good programming to enable good GUI scripting. From working on an email client with built-in scripting, we had a whole engine to handle how the script worked with the GUI. As we built almost our entire GUI at runtime from a resource file and supported dynamic addition/subtraction of GUI elements, it was important to have that engine.
Hypercard figured it out for what they were doing, so Pythoncard is going in a good idealogical direction.
Technically, the models for doing GUI programming are a bit stone age. They have not evolved much for the past 10 years. I predict in the next 2-3 years, GUI programming will see some incredible changes in the development/framework models.
Python isn’t a scripting language. Python is best described as a general purpose fully object orientated language (or as the Python website says: “Python is an interpreted, interactive, object-oriented programming language”.)
Yes, it excels at scripting and is often lumped in with Perl, Tcl and co, but it seems to do just about anything well, unless sheer speed is the primary criterion. I am currently developing a full application using html windows, data grids (like a spreadsheet) and so on using wxPython (upon which Pythoncard is based). I have found it easy to learn, implement and maintain, probably easier than anything short of a GUI designer (there is one for wxPython called “Boa Constructor” but it’s still Alpha), and even then, maintainence is easier than with Delphi.
You are right though: GUI stuff has been static for an awful long time, but I’m not sure how it will change.
In the material I’ve read about Python, it has been described as a scripting language. Even Guido has described writing some sorts of Python programs as “script”. It is exclusively a “scripting” language? Heck if I know, I switched to Ruby a while back 😉
From O’Reilly —
This book describes how to use Python, an increasingly popular object-oriented scripting language.
From the Patterns people —
Python is an OO scripting language that does all the things that you can do with Perl or TCL only better since it was designed from the ground up as an OO language.
From the Great Computer Language Shoot-Out —
Guile, Lua, Perl, Python, Rep, Ruby and Tcl are all interpreted scripting / extension languages, and they can probably all be considered competitors in the same space. Perl, Python, Ruby and Tcl all come with extensive libraries in their standard distributions. Guile and Rep have less extensive libraries, and Lua is absolutely tiny, with no extra libraries.
From IBM —
Python is the other scripting language that starts with “P”.
From Guido —
Python is a versatile interpreted language that can be used for many different programming and scripting tasks on and off the Web. It has been used for everything from CGI scripts and HTTP servers, via HTML generators, to a complete browser with support for applets written in Python. And all this software is available for free on the Web! This article presents a smorgasbord of Python Web applications, culminating with a detailed example: a Python script to check links in a Web subtree.
From Javaworld —
Utilities such as IBM’s Bean Scripting Framework make hooking Tcl, Python, Perl, and other scripting languages into your Java application easy.
From Linuxworld —
You may have dismissed Python as just another scripting language beginning with ‘P,’ but more and more open source developers are finding Python has some bite
Not like any of this is that important, but sometimes one has just got to get into the bark.
This is kinda OT but has anyone ever done any GUI work in Perl? especially wxPerl?
i like Perl better than Python for serveral reasons…its regex support is incredible and IO is so easy to work with and there’s a module available from CPAN for nearly every task you could imagine
(don’t take this to be a “my language is better than yours” post b/c it’s not…i respect and like python too…perl’s just my preference)
I’ve used the Win32 module, but it’s not yet fully developed and definitely a pain to program with.
I am interested in other possibilities on the Win32 platform. I don’t find perl to be all that useful for GUI programming, but I can do God-like things with text using perl that I really miss with VB & C++
What’s really cool is that you can use python on the Sharp Zaurus PDA with the Qt GUI libraries to create high quality mobile apps really quickly. And you don’t have to write the code for 75% of the UI stuff because you can point and click it in Qt designer.
while your references clearly show, that in public perception Python appears to be a scripting language it should be mentioned that public perception is often neither consistent nor appropriate.
If Python counts as a scipting language, why do not name Lisp, Java or C# scripting languages as well? Their execution model is at least comparable, they’re comparable feature-wise etc.
In my opinion “scripting” is no longer an appropriate category but rather a consequence of marketing activities.
It is more useful to define scripting as a kind of programming style, rather than a particular language.
The best framework for GUI creation I seen so far is simply Rebol/View and its VID dialect. I am not saying it here to start some flame-wars, but rather to those interested in the issue – Rebol/View is at least another interesting model to study …
I gotta say, Python is incredible. To lump it as a scripting language, which as far as I can tell from most peoples reaction to the term, means something along the lines of “slow, maybe useful in one particular situation, generally esless to REAL programmers, piece of crap”. I am constantly running into people who, without any real experience with it, shun its “scripting” like nature. I suppose i dont really care, as it’s their choice to waste time in some other more “powerful” language to do somehting that python is perectly capable of handling…and doing so in a tenth of the typing and time or more. I personally do GUI app development in python…in BeOS, and its not tough at all…pathetically simple in fact. And I have found Python to be remarkably fast, certainly fast enough for the apps I am doing at the moment. Nothing can touch it in terms of flexibility. I use it for gui apps, cgi, scripting ala bash, etc…and I am just a beginner.
Anyway, had to toss in my thoughts on this one. I mean come on, getting BeOS AND Python in on the same post? hehe
I thought scripting was generally a good thing outside of the GUI environment. And even in the GUI environment as long as you have a good supporting framework, also a very workable approach.
One of the reasons I like Ruby is that it has that “scripting” mentality which I equate with “provides a simple approach to accessing functionality”.
The rub is building the good supporting framework so that straightforward “scripting” with Python, Ruby, Tcl, whatever, can access the GUI simply, easily, and powerfully.
I am also a fan of the Microsoft invention “binary behaviors” which was part of an IE beta a long time ago. It provided a very cool way of adding functionality to a browser app, so you could do some scripting and then some powerful low-level work that C/C++ and the Windows API provided for. Coupled with Chrome and GDI+, binary behaviors seemed good technology. Unfortunately, it was viewed by the Netscape idiots as a move to break compatibility and provide a tie to Windows. If Netscape had implemented binary behaviors, browser apps would be far cooler than they are currently. Yes, there were also some security concerns, but no more so than the current set of issues with ActiveX controls.
Anyhow, my little diversion aside, I think Python is one of the most interesting languages currently available. ILM uses an incredible amount of Python in their IT infrastructure. I was impressed by what they’ve built.
Rebol/View and the VID dialect seem like pretty interesting technogy. In some ways, they are similar to some of the XML resource formats for Windows dialogs. The level of high-level simplicity and integration between the resource format (VID) and the base language is impressive.
Rebol reminds me of Forth for some reason.
I’ll have to spend a little more time checking this out, if only for the sake that it’s from one of the Amiga architects 😉