Pyqt 简明教程
PyQt - Introduction
PyQt 是一个 GUI 小部件工具包。它是 Qt 的 Python 接口,这是功能最强大的跨平台 GUI 库之一。PyQt 由 RiverBank Computing Ltd. 开发。可以从其官方网站 riverbankcomputing.com 下载最新版本的 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 was developed by RiverBank Computing Ltd. The latest version of PyQt can be downloaded from its official website − riverbankcomputing.com
PyQt API 是一套包含大量类和函数的模块。其中 QtCore 模块包含用于处理文件、目录等的非 GUI 功能, QtGui 模块包含所有图形控制。此外,还有用于处理 XML (QtXml) 、SVG (QtSvg) 和 SQL (QtSql) 等的模块。
PyQt API is a set of modules containing a large number of classes and functions. While QtCore module contains non-GUI functionality for working with file and directory etc., QtGui module contains all the graphical controls. In addition, there are modules for working with XML (QtXml), SVG (QtSvg), and SQL (QtSql), etc.
Supporting Environments
PyQt 与所有流行的操作系统兼容,包括 Windows、Linux 和 Mac OS。它具有双重许可证,既可以获得 GPL 也可以通过商业许可证使用。
PyQt is compatible with all the popular operating systems including Windows, Linux, and Mac OS. It is dual licensed, available under GPL as well as commercial license.
Windows
您可以从上面与 Python 版本(2.7 或 3.4)和硬件架构(32 位或 64 位)相对应的下载链接下载并安装合适的安装程序。请注意,有两种可用的 PyQt 版本,即 PyQt 4.8 和 PyQt 5.5 。
You can download and install an appropriate installer from the above download link corresponding to Python version (2.7 or 3.4) and hardware architecture (32 bit or 64 bit). Note that there are two versions of PyQt that are available namely, PyQt 4.8 and PyQt 5.5.
PyQt4 适用于 Python 2 和 Python 3,而 PyQt5 只能与 Python 3.* 结合使用。
While PyQt4 is available for Python 2 as well as Python 3, PyQt5 can be used along with Python 3.* only.
PyQt4 Windows Binaries
PyQt4 Windows Binaries
PyQt4-4.11.4-gpl-Py3.4-Qt4.8.7-x64.exe |
Windows 64 bit installer |
PyQt4-4.11.4-gpl-Py3.4-Qt4.8.7-x32.exe |
Windows 32 bit installer |
PyQt4-4.11.4-gpl-Py3.4-Qt5.5.0-x64.exe |
Windows 64 bit installer |
PyQt4-4.11.4-gpl-Py3.4-Qt5.5.0-x32.exe |
Windows 32 bit installer |
PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x64.exe |
Windows 64 bit installer |
PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe |
Windows 32 bit installer |
PyQt5 Windows Binaries
PyQt5 Windows Binaries
PyQt5-5.5-gpl-Py3.4-Qt5.5.0-x64.exe |
Windows 64 bit installer |
PyQt5-5.5-gpl-Py3.4-Qt5.5.0-x32.exe |
Windows 32 bit installer |
Linux
对于 Ubuntu 或其他 debian Linux 发行版,使用以下命令安装 PyQt −
For Ubuntu or any other debian Linux distribution, use the following command to install PyQt −
sudo apt-get install python-qt4
or
sudo apt-get install pyqt5-dev-tools
您还可以在“下载”页面上获得的源代码中进行构建。
You can also build from the source code available on the ‘download’ page.
PyQt-x11-gpl-4.11.4.tar.gz |
Linux, UNIX source for PyQt4 |
PyQt-gpl-5.5.tar.gz |
Linux, UNIX, MacOS/X source for PyQt5 |
Mac OS
PyQtX 项目 ( http://sourceforge.net/projects/pyqtx/ ) 托管用于 Mac 的 PyQt 二进制文件。使用 Homebrew 安装程序,按以下命令执行操作 −
PyQtX project (http://sourceforge.net/projects/pyqtx/) hosts binaries of PyQt for Mac. Use Homebrew installer as per the following command −
brew install pyqt