|Tkinter - Most Popular Python GUI Framework|
|Written by Mike James|
|Tuesday, 05 July 2022|
Janet Swift has already taken a first look at this survey of over 23,000 Python developers and enthusiasts from almost 200 countries or regions, but I wanted to answer a very specific question. Which is the most popular way for Python developers to create a user interface?
One of Python's strengths is the number of libraries and developer tools in its ecosystem. But looked at from a different prespective this is also a weakness. Given the availability of competing third party add-ons for Python there is no such thing as a standard in several important areas.
The Frameworks and Libraries section of the Python Developer Survey starts with web frameworks, reporting that Flask (41%) and Django (40%) are top runners while 29% of respondents don't use a web framework. This seems to have face validity as 45% of respondents use Python for Web development - it is the second most popular arena after Data analysis, which is the use for Python cited by 51%.
Which Python users are most likely to need tools to create GUI interfaces?
The most obvious group is Desktop development which is an option selected by 19% of survey respondents. Unfortunately, the survey doesn't separate out GUI Framework tools, instead they are lumped together into "Other frameworks and libraries" a category dominated by Requests, an HTTP library used by 52%, and the imaging library, Pillow (31%); 19% of respondents don't use any of those listed. Five GUI toolkits are included in the list - Tkinter, used by 19% of respondents, PyQT (15%), Kivy (6%), wxPython (4%) and PyGTK (3%). Of course, there can be overlap with respondents selecting more than one of these.
The impossible to pronounce name "Tkinter" is shorthand for "Tk interface", which is easy to say and conveys the idea that is a Python binding to the Tk GUI toolkit. Co-written by Guido van Rossum and first released in 1991 it is considered Python's de facto standard GUI. Tkinter is free and is included with standard Linux, Windows and macOS installs of Python. Tkinter may be included in Python but there are attractive alternatives which make many a programmer think that perhaps Tkinter's days might be numbered.
The main contender to Tkinter, used by 15%, is PyQt, the Python binding of the cross-platform GUI toolkit Qt, pronounced "cute". Developed by Riverbank Computing and first released in1998 it supports Windows, Linus and macOS. It is subject to a variety of licences - GNU, GPL and commercial. It is currenly at version 6.3 which was released in April 2022. This is probably the GUI library that most people think of when considering any sort of alternative. It is sophisticated and promises a lot but to get it all you need a commercial licence.
wxPython was also first released in 1998 and its latest stable release. 4.1.1 was in November 2020. It is a wrapper to wxWidgets implemented as a Python extenstion module. It is free software under the wxWindows License which is approved by the Free Software Foundation and the Open Source Initiative. Dropbox is an application developed with wxPython but it is only used by 4% of respondents to the Python Developer Survey.
PyGTK wraps the GTK graphical user interface library. It too is free software and is licensed under the LGPL. Its original author is GNOME developer James Henstridge, but its most recent stable release, 2.24 was in 2011 and it has been replaced by PyGObject, which provides bindings for GObject based libraries including GTK, GStreamer, WebKitGTK, GLib and GIO. While PyGTK is used by 3%, its replacement isn't listed.
Kivy is a relative newcomer as it was originally released in 2011 and most recently updated, to version 2.1.0, in March 2022. It isn't an alternative to Tkinter as it fills a different niche - developing mobile apps and other multitouch apps requiring a natural user interface. It is distributed under the terms of the MIT License, and can run on Android, iOS, Linux, macOS, and Windows. It is used by 6% which fits with the finding that 6% of Python useage is for Mobile development.
PyGame is another framework that can be considered as an alternative to Tkinter and it is used by 13% of respondents to the Python Developer Survey, which accords well with 10% using Python for Game Development and 12% for Computer Graphics. PyGame was originally released in October 2000, written by Ppete Shinners to replace PySDL, and its most recent version 2.1.2. came outr in December 2021. It is released under the GNU Lesser General Public License which provides for it to be distributed with both open source and commercial software.
So what is the conclusion?
Tkinter is probably better regarded as the true standard Python GUI than many programmers think. It is easy to call it old and not exciting and to worry about its place in the future, yet more Python programmers use it than anything else and it is completely open source.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Wednesday, 06 July 2022 )|