# # Here we provide the necessary imports. # The basic GUI widgets are located in QtWidgets module. import sys from PyQt5.QtWidgets import QApplication, QWidget # Every PyQt5 application must create an application object. # The application object is located in the QtWidgets module. app = QApplication([]) # The QWidget widget is the base class of all user interface objects in PyQt5. # We provide the default constructor for QWidget. The default constructor has no parent. # A widget with no parent is called a window. root = QWidget() root.resize(320, 240) # The resize() method resizes the widget. root.setWindowTitle("Hello, World!") # Here we set the title for our window. root.show() # The show() method displays the widget on the screen. sys.exit(app.exec_()) # Finally, we enter the mainloop of the application. PyQt6 #! /usr/bin/env python3 # Character Encoding: UTF-8 # # Here we provide the necessary imports. # The basic GUI widgets are located in QtWidgets module. import sys from PyQt6.QtWidgets import QApplication, QWidget # Every PyQt6 application must create an application object. # The application object is located in the QtWidgets module. app = QApplication([]) # The QWidget widget is the base class of all user interface objects in PyQt6. # We provide the default constructor for QWidget. The default constructor has no parent. # A widget with no parent is called a window. root = QWidget() root.resize(320, 240) # The resize() method resizes the widget. root.setWindowTitle("Hello, World!") # Here we set the title for our window. root.show() # The show() method displays the widget on the screen. sys.exit(app.exec()) # Finally, we enter the mainloop of the application. Notable applications that use PyQt Anki, a spaced repetition flashcard program Calibre, an E-book management application Dropbox, a file hosting service Eric Python IDE Frescobaldi, a score editor for LilyPond music files Kodos, a Python Regular expression Debugger Leo, an outliner and literate programming editor Ninja-IDE, an extensible open-source Python IDE OpenLP, an open-source lyrics projection program OpenShot, a video editing program Orange, a data mining and visualization framework Puddletag, an open-source, cross-platform ID3 tag editor QGIS, a free software desktop Geographic Information Systems (GIS) application qutebrowser, a web browser with Vim-style key bindings and a minimal GUI. qt-recordMyDesktop, a Qt4 frontend for recordMyDesktop Spyder, a Python data science IDE TortoiseHg, a graphical interface for the Mercurial source management program (Hg) Veusz, a scientific plotting application GNS3, a network software emulator See