其实知乎,civilization等等是根据胶水语言Python开发的。PyQt是Qt的Python版本(Qt company),据说该Qt中的Q是Quasar的意思,而类的前缀(大写,Q在Haavard’s Emacs font很好看),t 代表toolkits,PyQt组合起来就是Python中Quasar开发包。我在实践中应用的是PyQt5用于GUI(Graphical user interface开发)。
安装的包包括pyqt5-tools,pyqt5designer,pyqt5三个。
pip install pyqt5-tools pyqt5designer pyqt5
安装完成后打开你环境中会发现多了个Designer.app:
比如我在mac上的路径是:
/Users/yuanhust/opt/anaconda3/envs/micropy/bin/Designer.app
![](https://img.haomeiwen.com/i6110655/78c24ee75dab2bf7.png)
在windows上路径是Lib/site-packages/QtDesigner
在这个地方设置:
![](https://img.haomeiwen.com/i6110655/289b3fb4d4ec5460.png)
其中PyUIC的program为环境路径,比如:Mac电脑上,对于PyUIC为
/Users/yuanhust/opt/anaconda3/envs/micropy/bin/python3.6
argument为
-m PyQt5.uic.pyuic -o
.py
work directory为
Qt Designer的program为
/Users/yuanhust/opt/anaconda3/envs/micropy/bin/Designer.app
work directory为
这样会发现tools--》External tools--》
多了Qt Designer以及PyUIC两个。
Qt Designer用于编辑GUI文件,后缀为ui。
PyUIC用于将GUI的ui文件转换为py文件。
![](https://img.haomeiwen.com/i6110655/33e440d458afc171.png)
网友评论