If you're wanting to develop a Python GUI anytime soon can I strongly suggest you re/learn Java. I recently wanted to produce a simple yet functional desktop app and decided to give Python a go. I'd later py2exe my creation to create an executable Win32 app. My thinking was that Python is much faster to develop with and so doing a simple GUI app using it must be simple too.
Oh how wrong I was.
Coding the GUI
First off I tried the oldschool method of developing the GUI by hand using Tkinter as it seemed to have the greatest level of documentation and it was the library used in the Programming Python book. Alas this brought back painful memories of oldschool Java GUI programming with extremely restrictive rules on placement and positioning. After 3 hours of trying to get exactly what I wanted I ended up with GUI cat-sick on my screen - not good.
I tinkered with a couple of ther other libraries wxPython, PyGtk and even EasyGUI (too basic) only to hit the same problem - lack of flexibility.
I decided to try a different approach and find a GUI capable of handling the graphical side of things for me - maybe its a cheaters way out but personally I wanted an app not an education.
PythonCard
Oh dear god in heaven above. This app has been getting developed in a cave by the most hardcore, life-starved, miserable geekjects on the planet. It's based on an age-old Apple Mac application for developing quick dirty GUI apps. Which is great except its method of working is completely different to any other IDEs out there. It does follow a convention - its just the convention died years ago. That doesn't deter the developers though and they still have arguments to this day about wether to make tab ordering an easier to access feature or just leave as is (NB: Tab ordering is determined by the ordering of the elements in the frame and so you use "send to back", "bring forward" commands - very intuitive).
Boa Constructor
You need a book to operate this and also colour blindness helps because the interface is...well....vile! It's a painful mess to use and I didn't even bother trying - I closed it down in disgust. End of story.
IronPython Studio
You need a full version of Visual Studio - no go.
PythonWorks
Project now dead.
PAGE (Python Automatic GUI Generator)
This is one hell of a piece of wonder. Its amazing the sub-sorry I can't be sarcastic any longer. It's rubbish, it performs a role and thats it. It simply generates your GUI code rather than being a full GUI IDE.
I eventually got onto Glade and there's a number of options here that Python can exploit however, I'd wasted far too much of my valuable time by this point so I decided to do the only sensible thing:
Remember My Java
I left Java many moons ago but from when I'd last used Netbeans I remember the GUI building facilities were absolutely stellar. I wasn't disappointed this time round either. I can't believe how far along its now come and developing a GUI app in Netbeans using the Swing and SwingX components is an absolute joy. Its making me want to make more and more - I've restarted learning Java and not looking back.
So if you want to create a GUI desktop app - don't use Python (or Ruby).












11 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
You quit too early (or rather, started with the worst options). It’s quite simple to use glade to design a GUI for pyGTK or qtdesigner for pyQT/pyKDE.
Of course, if you’re used to java, it’ll definitely seem easier in the beginning.
You’re wrong about IronPythonStudio - there is a standalone version that only requires the visual studio shell and not the full version of visual studio.
I prefer to design GUIs using Visual Studio Express (generating C#) and then subclassing in IronPython to provide the functionality.
There is also a wxPython GUI designer built into the (free) SPE IDE. Called ‘XRCed’. I’ve never used it myself…
There’s also a python interface to the Guichan library (it’s called pychan, surprise!)
Yeah, you certainly started at the wrong end: nobody uses any of those things. pygtk is pretty nice, and I hear of people using pyqt pretty often.
You are so correct and that is a big problem with most languages IMHO, not the language itself but the tools that supports the language.
I need to develop GUI application easily and coming from a Delphi background I miss the RAD environment in most other IDEs’.
The only two (new) languages that offers me GUI bliss is C# with Visual Studio Express or MonoDevelop(Based on SharpDevelop) and then like you mentioned Java with NetBeans.
But I’m not a big SWIK fan and I don’t see a nice RAD IDE for Eclipse SWT(URL or a point in the right direction anyone?).
Regards,
Not at all painful! I use PyQt4 and it’s graphical designer for dialogs and main windows and it is great to work with. Be sure to check it out.
But, PyQt4 is not open source is it? I think is only free for non-commercial projects, right?
PyQT4, like QT4 itself, is dual licensed. There’s a GPL-licensed version, so you can use it for any project you plan to GPL. Pretty sure that qualifies as opensource. There’s also a commercial license you can buy.
This seems eminently reasonable to me. If you want to charge for your software, buy your tools. If you want to free your project, you get the tools for free.
@Joe: Yis Qt4 is dual licensed so it is open source, but…
Can you give me the price for a commercial license? Without emailing Trolltech…
That makes me wonder: Why would Trolltech not put the price of Qt4 on their website(Yes I tried Google, the Trolltech site map etc.)
The only guess for me is that it is expensive. And I don’t want to touch a drug I can’t afford or spend time with a API I can’t use freely.
So you can tell me what ever you want about its’ dual license and that it’s open source, but in my humble opinion it restricts me and thus its not a option.
So I would be better of learning C# or Java if I want to create GUI applications easily.
Regards,
What about the wx designer I suggested?
Or using the IronPython Studio designer. Or using Visual Studio forms designer and still coding your app in IronPython.
(Or using a Java designer and coding your app in Jython.)
On the otherhand if you are determined to use another language then go for it.
For what it’s worth the company I work for has created a large desktop application (spreadsheet development platform) in IronPython. http://www.resolversystems.com/
SPE (the IDE) itself is a fairly large desktop application written in Python. There are plenty of other examples.