pyqt4 Hello World Program


Introduction

You need to know basics of Python Programming Language before you start with PyQt.

PyQt is a GUI widgets toolkit. It is a Python interface for Qt, one of the most powerful, and popular cross-platform GUI library. PyQt is a blend of Python programming language and the Qt library.

Here is an Hello World Program to get you started.

Remarks

Creating a simple GUI application using PyQt involves the following steps −

  1. Import QtGui module

  2. Create an application object.

  3. A QWidget object creates top level window. Add QLabel object in it.

  4. Set the caption of label as “hello world”.

  5. Define the size and position of window by setGeometry() method.

  6. Enter the mainloop of application by app.exec_() method.