Posts Tagged ‘gui’

Python GUI Programming? Painful

September 3rd, 2008

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).