In Windows, Eclipse + PyDev configure the Python + PyQt4 development environment and pydevpyqt4
This article describes how to configure the Python PyQt4 development environment in Windows.
1. Download related software
Eclipse: http://www.eclipse.org/downloads/
JRE: http://www.java.com/zh_CN/download/manual.jsp
Python: http://sourceforge.net/projects/pydev/
Python: http://www.python.org/getit/
PyQt4: http://www.riverbankcomputing.co.uk/software/pyqt/download
2. Install jre, Python, and PyQt. Use the default settings for installation. click Next.
OS: 64-bit for Windows 7 flagship Edition
The software version is as follows:
Jre-7u9-windows-x64.exe
Python-3.3.0.msi
PyQt-Py3.3-x86-gpl-4.9.5-1.exe
3. decompress the Eclipse and PyDev packages.
3.1 decompress the eclipsecompressed package (eclipse-jee-indigo-sr1-win32-x86_64.zip) to a folder (c: \ eclipse)
3.2 decompress the PyDev package (PyDev 2.7.1.zip) and overwrite the two folders with the same name in Eclipse.
4. Configure Eclipse
4.1 open eclipse.exe and configure the workspace path for the first time
4.2 select window --> Preferences
4.3 In the displayed dialog box, select PyDev --> Interpreter-Python and click "New...".
4.4 enter the name of the pythoninterpreter and the address of python.exe. Click OK to confirm.
4.5 Select All, click OK to confirm
4.6 click "Forced Builtins" and select "New..."
4.7 enter "PyQt4", click OK
4.8 after you confirm that the Forced Builtins contain PyQt4, click OK.
5. Create a PyDev Project
5.1 Right-click and choose New --> Project
5.2 select PyDev --> PyDev Project and click Next.
5.3 enter the Project Name, select Grammar Version --> 3.0, select Interpreter --> Python3.3, and click Finish.
6. Write test code
6.1 right-click the src folder and choose New --> PyDev Module to create a Python Module.
6.2 enter the module name and click Finish.
6.3 test Python
Test code:
print("hello world")
Click the Green run button to execute
The output in the Console bar is normal, that is, OK.
6.4 test PyQt4
Test code:
from PyQt4 import QtGui import sys app = QtGui.QApplication(sys.argv) button = QtGui.QPushButton('button') button.show() sys.exit(app.exec_())
Click the Green run button to execute
If a button window is displayed, OK is displayed.
The above is all the content of this article, hoping to help you learn.