Start pyqt. Record your learning by the way! For more information, see pyqt4's amazing examples and the book "conquer Python.
The following is a demo:
#-*-Coding: UTF-8-*-# encoding declaration _ author _ = 'hmily 'import sysfrom pyqt4 import qtcorefrom pyqt4 import qtguiapp = qtgui. qapplication (sys. argv) # create the qapplication object button = qtgui. qpushbutton ('Hello World') # create a qpushbutton object and set the text button. show () # display this button. When the control is created, it is not displayed by default # When the button is pressed, the clicked signal is triggered, and the channel quit () response button of the connected qapplication object is clicked, execute the app to exit the application. connect (button, qtcore. signal ('clicked () '), app, qtcore. slot ('Quit () ') # enters the message loop and returns the value of exec _ () when the application exits. App.exe C _()
Running interface:
Pyqt entry series (1): Hello World