Introduction to PySide toolkit
last modified October 18, 2023
This is an introductory PySide tutorial. The purpose of this tutorial is to get you started with the PySide toolkit. The tutorial has been created and tested on Linux.
About PySide
PySide is Python library to create cross-platform graphical user interfaces. It is a Python binding to the Qt framework. Qt library is one of the most powerful GUI libraries. The official home site for PySide is qt-project.org/wiki/PySide. The installation instructions can be found at pypi.python.org/pypi/PySide.
PySide is implemented as a set of Python modules. Currently it has 15 modules.
These modules provide powerful tools to work with GUI, multimedia, XML documents,
network or databases. In our tutorial, we work with two of these modules.
The QtGui
and the QtCore
modules.
The QtCore
module contains the core non GUI functionality. This
module is used for working with time, files and directories, various data
types, streams, URLs, mime types, threads or processes. The QtGui
module contains the graphical components and related classes. These include
for example buttons, windows, status bars, toolbars, sliders, bitmaps,
colours, fonts etc.
PySide has been released after Nokia, the owner of the Qt toolkit, failed to reach an agreement with Riverbank Computing to include the LGPL as an alternative license. PySide has a high API compatibility wit PyQt4, so migrating to PySide is not difficult.
Python
Python is a general-purpose, dynamic, object-oriented programming language. The design purpose of the Python language emphasizes programmer productivity and code readability. Python was initially developed by Guido van Rossum. It was first released in 1991. Python was inspired by ABC, Haskell, Java, Lisp, Icon and Perl programming languages. Python is a high level, general purpose, multiplatform, interpreted language. Python is a minimalistic language. One of its most visible features is that it does not use semicolons nor brackets. Python uses indentation instead. There are two main branches of Python currently. Python 2.x and Python 3.x. Python 3.x breaks backward compatibility with previous releases of Python. It was created to correct some design flaws of the language and make the language more clean. This tutorial covers Python 2.x versions. Most of the code is written in Python 2.x versions. It will take some time till the software base and programmers will migrate to Python 3.x. Today, Python is maintained by a large group of volunteers worldwide. Python is open source software.
Python is an ideal start for those, who want to learn programming.
Python programming language supports several programming styles. It does not force a programmer to a specific paradigm. Python supports object oriented and procedural programming. There is also a limited support for functional programming.
The official web site for the Python programming language is python.org
Python ranks among the most popular programming languages. According to the langpop.com, Python ranks on the 6. place. The TIOBE index puts Python on the 8. place. On github.com, a popular repository of software projects, Python is the third most popular language, having 9% share of all projects hosted.
Python toolkits
For creating modern graphical user interfaces, Python programmers can choose among these decent options: PySide, PyQt4, Python/Gnome (former PyGTK) and wxPython.
This chapter was an introduction to PySide toolkit.