PySide is a
Python binding
Binding may refer to:
Computing
* Binding, associating a network socket with a local port number and IP address
* Data binding, the technique of connecting two data elements together
** UI data binding, linking a user interface element to an eleme ...
of the
cross-platform
In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software ...
GUI
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
toolkit
Qt developed by
The Qt Company
The Qt Company (pronounced "cute"; formerly Trolltech and Quasar Technologies) is a software company based in Espoo, Finland. It oversees the development of its Qt application framework within the Qt Project. It was formed following the acqui ...
, as part of the Qt for Python project. It is one of the
alternatives
Founded in 1994, Alternatives, Action and Communication Network for International Development, is a non-governmental, international solidarity organization based in Montreal, Quebec, Canada.
Alternatives works to promote justice and equality am ...
to the standard library package
Tkinter
Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's ''de facto'' standard GUI. Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python.
...
. Like Qt, PySide is
free software
Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, ...
. PySide supports
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which i ...
/
X11
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.
X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wit ...
,
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
, and
Microsoft Windows.
History
By 2009,
Nokia
Nokia Corporation (natively Nokia Oyj, referred to as Nokia) is a Finnish multinational telecommunications, information technology, and consumer electronics corporation, established in 1865. Nokia's main headquarters are in Espoo, Finlan ...
, the then owners of the Qt toolkit, wanted Python binding available under the
LGPL license. Nokia failed to reach an agreement with Riverbank Computing the developers of
PyQt
PyQt is a Python (programming language), Python Language binding, binding of the cross-platform GUI toolkit Qt (toolkit), Qt, implemented as a Python Plug-in (computing), plug-in. PyQt is free software developed by the United Kingdom, British firm ...
Python binding.
In August, Nokia released PySide. It provided similar functionality, but under the LGPL. 'Side' is Finnish for binding.
There have been three major versions of PySide:
* PySide supports Qt 4
* PySide2 supports Qt 5
* PySide6 supports Qt 6
PySide version 1 was released in August 2009 under the
LGPL by
Nokia
Nokia Corporation (natively Nokia Oyj, referred to as Nokia) is a Finnish multinational telecommunications, information technology, and consumer electronics corporation, established in 1865. Nokia's main headquarters are in Espoo, Finlan ...
,
then the owner of the Qt toolkit, after it failed to reach an agreement with
PyQt
PyQt is a Python (programming language), Python Language binding, binding of the cross-platform GUI toolkit Qt (toolkit), Qt, implemented as a Python Plug-in (computing), plug-in. PyQt is free software developed by the United Kingdom, British firm ...
developers Riverbank Computing to change its licensing terms to include
LGPL as an alternative license. It supported Qt 4 under the operating systems Linux/X11, Mac OS X, Microsoft Windows,
Maemo
Maemo is a software platform originally developed by Nokia, now developed by the community, for smartphones and Internet tablets. The platform comprises both the Maemo operating system and SDK. Maemo played a key role in Nokia's strategy to c ...
and
MeeGo
MeeGo is a discontinued Linux distribution hosted by the Linux Foundation, using source code from the operating systems Moblin (produced by Intel) and Maemo (produced by Nokia). Primarily targeted at mobile devices and information appliances ...
, while the PySide community added support for
Android
Android may refer to:
Science and technology
* Android (robot), a humanoid robot or synthetic organism designed to imitate a human
* Android (operating system), Google's mobile operating system
** Bugdroid, a Google mascot sometimes referred to ...
.
PySide2 was started by Christian Tismer to port PySide from Qt 4 to Qt 5 in 2015.
The project was then folded into the Qt Project. It was released in December 2018.
PySide6 was released in December 2020. It added support for Qt 6 and removed support for all Python versions older than 3.6.
The project started out using Boost.Python from the
Boost C++ libraries
Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It conta ...
for the bindings. It later created its own binding generator named Shiboken, to reduce the size of the binaries and the memory footprint.
Hello, World! example
# Import PySide6 classes
import sys
from PySide6 import QtCore, QtWidgets
# Create a Qt application
app = QtWidgets.QApplication(sys.argv)
# Create a Window
mywindow = QtWidgets.QWidget()
mywindow.resize(320, 240)
mywindow.setWindowTitle('Hello, World!')
# Create a label and display it all together
mylabel = QtWidgets.QLabel(mywindow)
mylabel.setText('Hello, World!')
mylabel.setGeometry(QtCore.QRect(200, 200, 200, 200))
mywindow.show()
# Enter Qt application main loop
sys.exit(app.exec())
See also
*
PyQt
PyQt is a Python (programming language), Python Language binding, binding of the cross-platform GUI toolkit Qt (toolkit), Qt, implemented as a Python Plug-in (computing), plug-in. PyQt is free software developed by the United Kingdom, British firm ...
*
PyGTK
PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its or ...
*
wxPython
wxPython is a wrapper for the cross-platform GUI API (often referred to as a "toolkit") wxWidgets (which is written in C++) for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension ...
References
External links
Official websiteDocumentationon the Qt Documentation web site
Qt for Pythonon the Qt wiki
Differences Between PySide and PyQton the Qt wiki
Python (programming language) libraries
Qt (software)
Widget toolkits
{{Free-software-stub