views:

117

answers:

1

What is the most used of these library and why ?

What are the differences ?

+7  A: 

I can't really say which one is the most used, but here are some feature comparisons:

Tkinter:

  • Built in to Python
  • Not native-looking GUIs by default before Python 2.7
  • Simple, easy to learn
  • In Python 2.7, ttk support was added (themed widgets)

PyGTK:

  • Focused on Linux, works on Windows but can be a pain (thanks to detly for pointing this out)
  • Has a GUI designer, Glade
  • More functionality/weight than Tkinter
  • LGPL

wxPython:

  • Cross-platform
  • Native widgets on each platform
  • More functionality/weight than Tkinter
  • GUI designers like wxGlade and others
  • Wxwidgets license (similar to GPL)

pyQt:

  • Cross-platform
  • Native (or at least native-looking) widgets on each platform, styleable with CSS
  • More functionality/weight than Tkinter
  • GPL licensed (commercial licenses available)
  • QtDesigner (made by Nokia) and utilities to convert to Python

pySide:

  • Python Qt binding (like PyQT) but LGPL
  • Linux-only, Windows version is experimental

PyQt, wxWidgets, and pyGTK all support OpenGL.

All three have webkit bindings, though PyQt's seem to be the easiest to use.

Tkinter is the simplest, but least feature-complete. wxPython and PyQT are probably the most powerful in terms of what's built in (as far as I know), but pyGTK is also good, especially if you're targeting Linux.

All are cross-platform.

Some links: http://stackoverflow.com/questions/1094155/developing-user-interface-in-python-tkinter-vs-pyqt

l33tnerd
Personally I would change "Mostly for Linux (?) (but does work on Windows)" to something like "Focused on Linux, works well on Windows but deployment is tricky". I use PyGTK for internal apps that run on Windows and Linux, and while threading can be a cross-platform speedbump, that's about it. The reason I specify "internal" is that *deployment* can be a real pain. If you control the environment and can install GTK+ and the necessary bindings, great! If you're sending it to a client... eek. (Then again, I **still** haven't come up with a remotely sane deployment strategy for wxPython either.)
detly
wxPython tends to crash a lot for me on linux, though mostly during development. If I give it the wrong options. or call things in the wrong order, BAM!, segv. I think tk has crashed on me about once or twice a decade.
Bryan Oakley
you say tkinter is ugly, but a) for most free apps that's of little concern. Pretty is nice, but functionality is more important. b) ugly is largely a function of the developer. Tkinter widgets can look clunky out of the box, but one can tweak the look to make apps largely identical to native apps. I will agree, though, that in the hands of an unskilled professional tk can look somewhat dull.
Bryan Oakley