Tips on Mac Python GUI Creation?

by Jeremy Jones

Does anyone have any tips on GUI building on Mac using Python? It looks like PyGTK for Mac isn't totally there yet. PyQT for Mac looks really out of date. Is building a Cocoa app using PyObjC my best bet? The more native, the better. The fewer dependencies, the better.

9 Comments

Simon Hibbs
2007-08-10 09:24:01
Well of course there's wxPython, which is cross platform yet uses native widgets. Of course it's programming model is a bit clunky, being a thin wrapper on the wxWidgets C++ libraries. I'd be very interested in how it compared to PyObjC, which I don't know at all.


One little-known option is to use the GUI layer from Dabo, a Python desktop database application framework. It wraps the wxPython library and makes it a lot more Pythonic and easy to use. My problemn with it is lack of documentation. I'm not a pro developer so I need handholding with this kind of stuff. Dabo looks amazing, but I've never got anything working with it properly, whereas wxPython is horribly complex but has stellar documentation and working examples. I've written several desktop utilities and little apps using it.


A real pro Pythonista shouldn't have too much trouble getting the hang of Dabo. It's at least worth taking a look. they have some very enticing demo videos and screencasts.

Cariaso
2007-08-10 09:30:31
Another vote for wxPython, and the book 'wxPython in Action'
Joshua Bloom
2007-08-10 09:38:16
I'm interested in this as well. I've recently moved to the mac and am looking into writing apps and prototypes for the platform. So far my research and light testing is definitely pointing me to PyObjCX as the best way to build GUI's for the mac.


I like the concept of cross platform gui building, but it seems like you give lose too much going that way.


Oh I also miss pyScripter as a python ide...

Kevin Ollivier
2007-08-10 10:14:00
Any reason why you ruled out wxPython? It even comes with OS X, so you don't need to include hardly any deps yourself, as with PyObjC.

2007-08-10 10:22:31
Go with PyObjC, since it will be officially supported by Apple in Leopard, and will even have full Xcode/Interface Builder integration.
Paul Hummer
2007-08-10 10:25:06
Jeremy-


As a Linux zealot who has recently coverted to Mac OSX (at least on my laptop), I went searching for GUI creation tools. I'd heard a lot about PyObjC, but then stumbled back across and an old friend: wxPython. I'd HIGHLY recommend it, especially since you're already experienced with python. wx feels a lot like PyGTK, which I learned after wx, and loved it.


The great thing is that it's cross platform. I just taught my 11-year-old brother to use wxPython on Windows with the tutorials at http://www.showmedo.com Once he got the hang of it, he was off to the races, and built a control interface for his robot.


Paul

Jonathan Wight
2007-08-12 20:52:31
A little late to the party, just got back from C4... If you want a Mac app that doesn't look like a garish port of a Unix/Windows app then use PyObjc. If that matters to you (i.e. you're not whipping up a quick in-house tool) then you'll find it to be a great API for making Python GUI apps on Mac OS X. A great example of a pure PyObjc app is Thumbscrew by Zachery Bir: http://www.urbanape.com/
todd
2007-08-13 13:43:16
You should also look at Adobe AIR. It's based on Flex, but it's a simple install for end users. You're not going to get all the native stuff, but depending on what your app needs to get done, you can definitely make a spiffy UI, with access to local files and SQlLite database.


--Oops, you wanted just Python. I gave up on trying to make UIs in Pythong a long time ago, and just stick to server-side code.

Drew McCormack
2007-08-16 12:33:38
No contest in my view: if you want a great Mac experience, you have to go PyObjC. And it will be officially sanctioned in Leopard.


If you want to see what is possible with PyObjC, take a look at Checkout (http://www.checkoutapp.com/).


Drew