Graphical frameworks

There are a number of GUI frameworks available nowadays. Since we are using Python, we will look at Python-specific frameworks:

  • Tkinter: This is actually a Python binding for the Tk GUI toolkit. It is considered to be the standard Python GUI framework that is available on all OS installations of Python. For a long time, the widgets included in Tkinter didn't use the OS-scheme, so Tkinter applications looked out of place. That has been fixed in the
    latest versions, so now Tkinter programs look like native applications.
  • wxPython: This uses a Python wrapper for the cross-platform wxWidgets toolkit. There was a time when it was considered as the replacement for the built-in Tkinter framework, but that hasn't happened. The main code is compatible with Python 2.x, while the Phoenix Project was designed to create a Python 3.x-compatible version from the ground up. wxPython uses native OS widgets, so it looks like a native application. A graphical designer, wxGlade, is available to help lay out the GUI prior to coding the functionality.
  • PyQT: Yet another framework that wraps a Python binding around another toolkit, in this case the cross-platform Qt toolkit. PyQT is considered by many to be the primary GUI framework for Python applications, as Qt was designed for business application development and has more than 400 classes and over 6,000 functions and methods. Of course, with that power comes a steeper learning curve than other toolkits.
  • Kivy: Unlike the other tools, Kivy is a pure-Python library and not a wrapper around another language's toolkit. It is cross-platform, as well as cross-device, so you can run the same application on a Windows PC, an iPad, or Android phone. Programs can be written in pure Python, or optionally you can create a hybrid program that uses Python for functionality and the Kv language for user-interface markup; this helps separate functionality from design.

There are many other GUI frameworks available, so the reader is encouraged to look at the options available before committing to a particular one.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.70.185