Question

If one wants to develop a user interface in Python, which one to go for: TkInter or PyQt?

I just started with TkInter and I was able to get some simple UIs going with elementary widgets like label, button, text box etc. Just curious to know how good PyQt would be compared to TkInter?

cheers

Was it helpful?

Solution

PyQt if you're developing anything serious, especially as things you learn will translate directly to working with Qt in other languages too if you ever need to, and Qt is probably the best cross-platform interface toolkit available right now.

There are only two real (potential) disadvantages:

PyQt is only available under the GPL. This means if you release your code, it has to be available under a compatible license, under the terms of Nokia's GPL Exception, or under a commercial license (which costs money). This is in contrast to Qt, which is now available under the LGPL.

PyQt is not included by default with Python installations. You're going to have to package the library yourself. (Ars Technica has a good article on doing it for Windows and OS X.)

OTHER TIPS

PyQt is our main GUI toolkit now and after 1 year of development I don't want to return to anything else. It's stable, mature, cross-platform and completely native. Even the system dialog boxes (for example to open files) are the ones used by your operating system.

I tweaked my XP theme and now my apps skin accordingly. This creates a very professional look, not comparable with a toolkit like Swing. The API is extensive and goes beyond the pure GUI things like widgets. It has support for database connectivity, printing, threading (I used it and it works like a charm),... I even use it to generate PDF's (no other external libs needed). I would recommend Mark Summerfield's book though 'Rapid GUI Programming with Python and Qt' to get you on speed. Keep in mind that Qt comes with a GUI builder (Qt designer) which is the best I have used (and I tried lots of them).
I even use this builder to create mockups to show to users (it is that easy!).

I introduced it to 2 other developers here and haven't heard them complaining...

I am using tkinter for small applications with simple interface. I like it very much, even if the lack of good WYSIWYG editor might be a problem for a bigger app.

For big apps, PyQt might be a better choice. It has a very good screen designer, but the licensing may be a problem.

Finally, wxPython may be a good alternative, because it doesn't have these drawbacks.

PyQt is really easy to learn and docs for Qt also works for PyQt also there are ports to .NET and Java. So, it is fairy cross platform and cross language. Also you have PyQt integrated in Eric IDE.

The support for CSS styles is also really brilliant.

See new OpenSuSE installer to see what you can do with it.

You can create huge GUIs using Tkinter. If you like try the pytkgen module it helps creating Tkinter GUI's from JSON definitions: https://github.com/tmetsch/pytkgen

I use PyQt - Cross-platform, Easy to work with and reliable.

I used TkInter very light and I cant find a point making tkInter better then PyQt.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top