环境准备
1.安装Python和编译器(这里使用PyCharm)
2.在PyCharm当中进行设置:File->Settings->搜索Interpreter,设置为System Interpreter(设置为你安装的Interpreter,一般用系统的就行)
3.不能调试的情况下选择Run->Run,使Pycharm自动配置Debug环境
经过以上的步骤我们就可以编译程序了,我们这里需要编写PyCharm程序,故打开cmd,输入pip install pyqt5,安装组件包
同时还有辅助开发的GUI工具包,我们使用代码的方式进行开发,故不安装
Example
这样我们就可以运行pyqt5的程序了。先上一段示例代码:
import sys
from PyQt5.QtWidgets import (QWidget, QPushButton, QDesktopWidget, QApplication,
QHBoxLayout, QVBoxLayout)
from PyQt5.QtCore import (pyqtSignal, QObject)
class Example(QWidget):
def __init__(self):