Category Archives: PyQt

Python GUI

A GUI (graphical user interface) can be made with Python modules.There are lots of modules designed for that. One of the oldest ones is Tkinter, the standard graphical interface package. Through the years more modern modules have come out: Qt and WxWidgets. Related Course: Create Simple GUI Applications with Python and Qt PyQT The PyQT […]


Create a graphical user interface with Python. Python is not limited to making terminal applications. Why not make desktop apps? Applications made with Python and Pyqt work on Windows, Mac and Unix. There are two major versions of Pyqt: PyQt4 and PyQt5. PyQt is the most popular GUI module for Python. Install PyQt To install […]

pyqt5 hello world

Make a graphical interface with PyQt? Graphical interfaces made with PyQt run on: Microsoft Windows, Apple Mac OS X and Linux. We will create a Hello World app with PyQt. Install PyQt PyQt is available for both Python 2 (2.7.9 tested) and Python 3. To install write: pip3 install pyqt5 With apt-get you can use: […]

pyqt5 center window

To center a PyQt window, we need to do a bit of trickery: we need to get the window properties, center point and move it ourself. At the start of the program, it will be in the center of the screen. pyqt center screen We add QDesktopWidget to the list of imports, having:

Include […]

pyqt5 button

Add a button in pyqt? Learn how to add button widgets to an existing Pyqt window. Learn how to connect a click to a Python method. Introduction The button widget is called QPushButton. Start by importing QPushButton

In the window constructor, add these lines

The first line creates an object of the type […]

pyqt5 message box

When creating a Python GUI, you may want to show a message box at some point. Pyqt comes with messagebox support in both PyQt4 and PyQt5. The class to be used is QMessageBox. In this tutorial you’ll learn how to show a message box on buton click. QMessageBox example Import QMessageBox from the PyQt5 widgets […]

pyqt5 tooltip

A tooltip is a hint in a graphical interface. Tooltips frequently appear when hovering the mouse over a widget (without clicking). Pyqt supports tool tips, they can be configured for widgets. Note: Tooltips are not shown on mobile devices because there’s no mouse cursor. Pyqt5 tooltip A tooltip can be set using a widgets setTooltip […]

pyqt menu

Do you want a menu in your PyQt app? Pyqt has menu support. Almost every GUI app has a main menu at the top of the window. Adding a menu works slightly different than adding widgets. A menu can contain sub menus, they are usually something like (File, Edit, View, History, Help). Every menu has […]

PyQt line edit

In this tutorial we’ll make an app that displays an input field. A textbox or LineEdit can be created using the QLineEdit class. Many applications have text inputs like form fields and the like. Introduction Start by importing the QLineEdit widget:

We will also add a text label, to show the user what to […]

pyqt5 video widget

In this article you’ll see the code to create a video player with PyQT5. It contains a menu bar for opening the video file. PyQt5 supports multimedia, including a video widget: QVideoWidget. This is used in combination with the class QMediaPlayer. The QMediaPlayer class has all kinds of properties that you may know from video […]