Piton

Python Desktop Graphic Frameworks

Python Desktop Graphic Frameworks
Your first lessons in Python is aimed at text input and input. Once you have gotten past the first programs that you run from the terminal, you want to make a graphical interface for your marvel of computing skills. When you search the web, you will find a long list of tools but the frameworks for the desktop might be hard to find. Here you will find a list with some description of the value they bring.

What frameworks are most common?

When you look up the Python documentation for Graphical User Interfaces, you find TkInter. The package is part of the default Python install. You can use this for the simplest applications just fine. You can also seek out frameworks that implement something else or put stuff on top of TkInter.

Some of the big, or rather, much used systems for Linux are QT and wxWidgets. These are so common, both on Linux, unix-like systems, Mac OS X and Windows, that you must be aware of them if you are creating GUI programs.

QT is one of the standards for the desktop. It also includes classes to handle most functions of the computer. This include sockets, threads, Unicode and its own web browser. PyQt has bindings to all the parts of this framework.

wxWidgets Has a very big API with many widgets and functions. These include the same as QT, as they are competing technologies. There are differences but the important part is that if you aim to do something big you must keep the two in mind. You may want to switch when and if your project grows.

Python 2 is out of maintenance!!

Before you decide, make sure you have support for Python versions higher than 3.0. Python version 2.0 is out of maintenance since the beginning of 2020.

Cross platform or just Linux?

In this article, you will see some examples, they are all supported by, and support deployment to, Linux. Before you start, consider what support you need; both development and deployment support to other platforms? Which ones?

First lets start with python frameworks that are small and easy to get started with listed below.

guizero - small, made for beginners.

Uses standard TkInter for the components. It has buttons, check boxes and many other types of widgets. Of course, you can get text and show the results, display pictures and run applications inside the windows created.

appJar - educational

appJar is meant to be educational, because of that, the designers have made it dead easy to install. The simplest way; Download and unpack in the sitepackages directory on your computer. It is available on PyPI also, though. It has few more functions than guizero.

Gooey - Command line GUI!

Is designed for you to transfer your command line tools to a GUI. It has toolbars, sliders and buttons, like the others only it is geared towards the ones of you who has already written a script and want to make a GUI for that.

Ok now, let's look at some more frameworks with are larger with a bit more learning curve, but all of these frameworks below have more capabilities.

Kivy - The bigger choice

This is a bigger framework that aims to support bigger projects. You can use this for most applications, in fact, they are supported by many businesses for all its powers.

Sugar - Aimed at education

This is a framework aimed at education applications. You can use it if you aim to write educational applications with flashy graphics. It is written in many languages, though Python is a big part of it. This is not so easy to get started with, but you have a wide range of possibilities available.

IDE support

When you start, you may already be using an IDE. So, do you need to switch to another one?

When you want to create your own applications, you can try it out in a web based interface. A REPL, if you will. To create Sugar activities, you need to understand PyGTK. If you are already programming in that, you can continue as usual. Just add the Sugar Toolkit and develop as usual.

This goes for the other ones also. guizero and appJar, for example needs only the library so you can import them. Gooey requires a pip install. With a virtual environment, it is very simple. Just use PyCharm or your favourite Python IDE.

Kivy has an easy guide to set it up for PyCharm, there are also solutions for Visual Studio, Eclipse and eric6. In the end, it is simple to just add the library and continue as usual.

Conclusion

When you are starting out creating graphical user interfaces using Python, you have many options. Several of these options are large and complicated. However, if you want to start out with something small or just have some small routines to implement, you can use the small ones mentioned above. With a little planning and a clear goal, you will be up and running in no time. Even the small frameworks usually build on top of the standard tool kits which are the platform independent ones. This makes the choice one of taste rather than tool capability.

Vulkan for Linux Users
With each new generation of graphics cards, we see game developers push the limits of graphical fidelity and come one step closer to photorealism. But...
OpenTTD vs Simutrans
Creating your own transport simulation can be fun, relaxing and extremely enticing. That's why you need to make sure that you try out as many games as...
OpenTTD Tutorial
OpenTTD is one of the most popular business simulation games out there. In this game, you need to create a wonderful transportation business. However,...