Is Python any good for GUI development?

*************I’ve made numerous UI’s in wxPython and would highly recommend it. I used to build in VisualC++/MFC then discovered wxWidgets/C++ and finally moved onto wxPython. I find I’m able to get working GUIs in no time at all with wxPython compared to the other methods and with almost no effort, the same source works works on Linux and the Mac* (sometimes you need some tweaks for visual anomolies). *I generally develop under Windows in case you hadn’t guessed. There’s a tool (wxDesigner) you can use to generate the layout for you or alternatively, you can play with it programmatically. Either way, layout under wxWidgets is done using Sizers. They’re quite a powerful way of laying out a GUI and once set up correctly, will automatically resize your controls appropriately for you. There’s a nice little tutorial on sourceforge with some good examples of what you can do with sizers. There’s another tool (wxGlade) I’ve just discovered which does what wxDesigner does, but for free from a quick trial, might actually be better as well.

****wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn’t the standard Python GUI toolkit is that Tkinter was there first.

— Guido van Rossum

******While I respect his opinion greatly, he doesn’t strike me as the sort of person that does very much GUI programming. If I didn’t do much GUI programming I’d vote for wxPython too. It has more eye candy, but I’m not convinced it’s superior to Tkinter.

*******You could try PyQt This uses the Qt toolkit for the GUI but you write your program in python. Qt Designer can be used to create GUIs graphically for use with PyQt. Qt Designer is the GUI building application for Qt. The python bindings for Qt are fine. If you want to take a look at current Qt applications you may checkout Google Earth and Skype.

*******There are excellent GUI options for Python. wxPython is a great place to start, pyQT is good if you have spare money.

The biggest issue I’ve seen is having a tool that lets you layout a form with the ease of Visual Studio — but I think pyQT has that one resolved, and wxWindows has a version you can pay for.

******To asnwer your question directly:

Yes, Python is excellent for GUI development. Python is dynamic and extremely flexible, traits that are very important for GUI development where one often needs to write a lot of boilerplate code. The bindings for some popular cross-platform GUI libraries (wx, Qt, etc.) are mature, stable, actively developed and well supported.

I’ve found performance of Python GUI bindings to be good (I’m personally using wxPython and have already written a few functional GUIs both for work and personal use). But if you want to improve it even further, I’m sure it’s not too hard to combine the Python binding code with C++ code (using the wxWidgets C++ libarary itself, for instance). Anyhow, I suspect this won’t be a problem for you.

******************As others have said, wxPython is a good GUI library. One thing that isn’t mentioned much is that you can combine wxPython with wxGlade to create many “drag and drop” programs.

wxGlade lets you quickly create the framework of your program; you don’t have to worry about any of the working code at first. You can just create the visual look until you get it just right. Once that’s done, then you start working on the actual coding, but you already have the GUI framework laid out for you. All you have to provide is the programming logic to make your application work.

One benefit of using Python for applications in general is the interpreted environment. You don’t have to do the check/compile/run cycle everytime. You can quickly make changes and see them nearly instantaneously, which greatly speeds up development.

Additionally, if you need to speed up the program, you can always write certain parts in C/C++ and pre-compile them. The cPickle module is an example of this. But for many GUI programs, the application will be waiting on the user so speed is usually not an issue.

**********Another good wxPython tutorial:

********wxPython is full of bugs on anything besides Windows. PyGTK2 is probably the best GUI toolkit but I don’t know on what platforms it is supported, probably everywhere gnome is.

********** I’ve actually done similar research lately as many of the artist I work with work on Macs. What I found is that wxPython seems pretty robust. My goals were for internal tools development, so I was looking for a more efficient development language than C# and Java.

I’m not an expert in wxPython, but if you are interested in GUI development in Python, I would give this API a try, or at least some research time.

******* Check out the Traits library from Enthought. It’s a way of describing different properties of objects, views of those properties, and dynamically updating views. I’m not really doing it justice, but it’s an extremely flexible, rapid-development library. Plus, it leads to reusable and extensible code. I’ve written a couple minor scientific applications in Traits, and I have found it to be an absolute dream, as it lets me focus on the data model rather than the UI.

***********Python is excellent for gui development
Speed of execution is less important than speed of development, GUIs change a lot. GUIs generally involve dealing with text and storing state – ideal pythonisms
If your app is in c++/c#, then having the gui written in a different langauge enforces gui/logic separation.

Options are: wxpython/pyQT – equally good, all the functionality of wx/qt from python, both the designers can spit out native python implementations.

IronPython – .net implmentation of python so all winforms and wpf directly from python. You get all the .net libs but only a subset of the native python ones, but it is very easy to mix python gui with other parts of the app writen in c# etc.

************You should take a look at IronPython. With it you can use the .NET Framework and I’m pretty sure somehow Mono too!

*********I personally find wxPython to be very clumsy. I’ve encountered many bugs while trying to use it and the backwards compatibility issue is quite bothersome. I guess that’s a complaint about python in general though.

Edit: More specifically, you have to actually uninstall a current version of python and install an old version to get some programs to work properly. I believe it was one of the programs I was using with Z/Eves. It’s been a few years.

**********With jython you could use Java Swing. 100% cross platform and everybody loves swing – right 😉

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: