2.5 GUI options for Python

We mentioned in Section 2.4 that different options may exist for a GUI library in a given programming language. In addition to Python's standard library GUI package called Tkinter, there are 3rd party alternatives such as the PyQt and PySide wrappers for the Qt library, Kivy, Toga, wxPython, and quite a few more. Have a quick look at the overview table provided at this GUI Programming in Python page to get an idea of what’s out there. In contrast to Tkinter, these 3rd party libraries require the installation of additional packages. 

There are quite a few other factors that affect the choice for a GUI library for a particular project including:

  • For which platforms/operating systems is the library available?
  • Does the library draw its own widgets and have its own style or use the operating system's native look & feel?
  • How large is the collection of available widgets? Does it provide the more specialized widgets that are needed for the project?
  • How easy is the library to use/learn?
  • How easy is it to extend the library with our own widgets?
  • How active is the development? How good is the available support?
  • Is the library completely free to use? What are the license requirements?

We will quickly look at Tkinter and Qt individually, using the same GUI example of a tool to convert miles to kilometers. In the rest of this section, we will focus on Tkinter and Qt with its two Python wrappers PyQt and PySide and focus solely on writing GUI-based Python programs with PyQt.