

Ask HN: Python GUI toolkits - jftuga

Since this was last asked on HN a few years ago, I thought I would ask again as things may have changed.<p>I am looking for a GUI toolkit for Python 3.2 that looks good on both Windows 7 and OS X.  Here the catch: I am at best an average programmer so I need something really easy to use.  My program will not be too complicated: I would just use listviews, buttons, text fields, etc.  Is creating the GUI widgets via an XML file (along with the layout) a good way to go these days?  It seems like this would be easier to develop and maintain.<p>Right now, I have a good command-line version of my program and want to add a GUI to it.  I'd also love to "compile" the Python code and then be able to distribute it a .exe installer or a .dmg image.<p>Any help would be greatly appreciated.  Thanks!
======
wlesieutre
Take a look at PySide. It's an alternative to PyQt with less restrictive
licensing. You can use Qt Designer to visually edit GUIs, and then
automatically produce the code for it using pyside-uic. I'm in a similar boat
and just started looking at it recently, but it seems like a solid option.
Nicer than Tkinter, I think.

<http://www.pyside.org/>

<http://zetcode.com/gui/pysidetutorial/>

------
pendragon
XML Doesn't necessarily make it easier. Maintaining and changing things down
the road is better. wxPython doesn't have XML examples for every widget and it
does make trying new things out more involved. wxPython isn't a pure MVC
design. Hopefully a more expert developer will discuss this.

I would suggest looking at the most popular tookits and making an example
screen with all the widgets you'll need in each and then testing it in
OSX/Windows 7. Shouldn't take you too much time. Screen shots should filter
the toolkits down to a reasonable number.

Another approach is to separate your presentation layer completely so that you
can use different toolkits on each platform. With two platforms you'll only
have to learn the basics of two libraries. If you move to Linux later this
would allow you to use QT/GTK+ as well.

------
decadentcactus
I've been using wxPython for a desktop client (tied to a website). Initially I
tried to make it all by myself, then got a visual creator, and productivity
went WAY up.

I used wxFormBuilder: <http://sourceforge.net/projects/wxformbuilder/>

It's pretty much a point-and-click sort of thing, but after the initial
drafting/mockups I tweaked it by hand (small things like names/strings, as
well as adding the events). I used Python 2.7 - not sure about 3.2.

If you need any help send me an email and I'll do my best to help. I've
managed to compile/run it on Windows ok, and as far as I'm aware it's possible
to compile it for Mac/Linux. I just have no Mac to test.

~~~
arocks
After comparing a lot of cross-platform GUI toolkits in Python, I too settled
on wxPython because it gives the closest possible 'native' experience on each
platform. It also worked well with Py2EXE and other packaging tools. Would
highly recommend that you give it a try.

------
jftuga
Thanks for all of the comments. I'll be checking out both PySide and wxPython
( and wxFormBuilder ).

However, from the PySide web page, "There are no PySide core developers using
Windows or Mac and no more PySide build bots, so if you really want to see
PySide running on those platforms better you do something."

------
zhicheng
You can wrap native ui by hand,It's best way get good looks.But it you just
want feature works,tkinter is the best choice.

------
Executor
Tkinter (shitty, but standard), wxWidget, or QT

