DEV Community

Cover image for Python GUI, PyQt vs TKinter

Python GUI, PyQt vs TKinter

amigos-maker on October 31, 2019

Both Tkinter and PyQt are useful for designing acceptable GUI’s, but at the same time, they differ in terms of adaptability and functionality. Mo...
Collapse
 
rodeone2 profile image
robin deatherage

Actually it is Tk that is far more advanced than PyQt or Wx. I will explain why. Tk is still ahead of most all GUI Toolkits by as much as fifteen to twenty years as it is one of three of the only GUI Widget Toolkit made from the Original Toolkit Library.

And is one of only three GUI Toolkits besides GTK and the NCSA Mosaic Canvas Toolkit that powers both the proprietary underlying HTML rendering Engines used by Netscape Navigator, WebKit, WebView, IE, Edge, Safari, Chrome, Chromium among a few others.

The main reason it is so advanced is its ability to pre set JavaScript triggers for after render events with its tags, marks, configs() and its Binding Methods. One of these binding methods is the ability to set hyperlinks while suspending their path data for processing web request from user clicks in both regular and OpenClick() events.

Many also are not aware that before 2009 there were still over fifty Web Browsers with Rendering Engines entirely developed using Tk that at that time were still being downloaded. Now Python does lack the 3D OpenGL that comes with Tk 8.6 and lacks the Video Codecs that are also in the Tk version, but they can be PyObject directly tied in and used, but only a handful of us are doing so.

Also to Mimic all other GUI Libraries all one has to do is place all widgets and or create your own and ploace them individually inside Frames for each one. The Frames are the secret behind Tkinter and if placed within a Canvas give you full things such as radius buttons, cells for rendering HTML Blocks and or New Widgets. Thanks !

Collapse
 
ertywek profile image
ErtY'wek

"The main reason it is so advanced is its ability to pre set JavaScript triggers for after render events with its tags, marks, configs() and its Binding Methods. One of these binding methods is the ability to set hyperlinks while suspending their path data for processing web request from user clicks in both regular and OpenClick() events. " Can you explain to a programming newbie?

Collapse
 
vicmeunier profile image
Victor Meunier

Interesting comparison. I've used Qt in C++ in the past and recently used PyQt5 to make a prototype (github.com/MrEliptik/shotty) and I loved it! The lack of python specific documentation can be a bit painful from time to time but hopefully someone on SO faced the same issue. Also, the bindings are really similar to Qt for c++ so usually you can use the C++ docs.
You talked about Widgets for PyQt but you could also use QML right? I think it's especially interesting since it enables a lot of customization and can be interesting to make good looking apps such as desktop.telegram.org/.

Collapse
 
amigosmaker profile image
amigos-maker

Looks like a cool app you made! Right, you can use QML also

Collapse
 
mikaeal profile image
michael

I think Tkinter is underrated...partly because of the learning curve as you have to code every widget.But when you get a hang of it, it’s really great.