参照
http://www.saltycrane.com/blog/2007/01/how-to-install-pyqt-41-python-25-and-qt_8340/
安装PyQT4环境。
Here are the steps to install and create a simple "Hello World" GUI application using PyQt 4.4, and Python 2.5, on Windows.
Install Python 2.5
- Go to http://www.python.org/download/ and click on "Python 2.5.x Windows installer"
- Save and run the Windows installer
- Go through the steps and accept the defaults.
Install the PyQt 4.4 bundle (including QT 4.4)
- Go to http://www.riverbankcomputing.co.uk/software/pyqt/download and select the "PyQt-Py2.5-gpl-4.4.2-1.exe" link.
- Save and run the file.
- Go through the steps and accept the defaults.
Run a "Hello World" application
- Go to "Start" -> "All Programs" -> "Python 2.5" -> "IDLE (Python GUI)"
- Open a new window ("File" -> "New window")
- Type the following code inside and save:
import sys
from PyQt4.QtGui import *
app = QApplication(sys.argv)
button = QPushButton("Hello World", None)
button.show()
app.exec_() - Hit "F5" to run. A window with a single push button should pop up.
For more examples, go to "Start" -> "All Programs" -> "PyQt GPL v4.4.2 for Python v2.5" > "Examples" > "PyQt Examples Source" (For a default installation, this is also located at C:/Python25/PyQt4/examples
.) To start, look in the "tutorial" directory.
安装Python 2.7和对应的PyQT4-Py2.7包成功,不再需要另装MinGW。