传统的命令行界面--比如git工具
什么是GUI
图形化用户接口
GUI编程
tkinter:原生态的工具,亲儿子,是python最简单的图形化模块,总共有14种组件
pyqt:是python最复杂也是使用最广泛的图形化
wxpython系列:是python当中居中的一个图形化,学习结构清晰
pywin:是python Windows下的模块,摄像头控制(opencv)常用于外挂制作
PySide2:
对比结论
1.使用pyside设计GUI页面的时候工具可以支持中文模式,功能与pyqt类似,足够满足日常测试开发需求
2.UI设计+py逻辑处理独立,相互调用
安装PySide2库
pip install PySide2 如果网速慢,使用豆瓣原
打开方式:
选择widget,点击创建即可
可以拖动左边栏的组件到窗体中进行设计了
D:\py project\DevTools>python -m ensurepip
Looking in links: c:\Users\gavin\AppData\Local\Temp\tmpg6y94cio
Requirement already satisfied: setuptools in d:\soft\python3.8\lib\site-packages (47.1.0)
Processing c:\users\gavin\appdata\local\temp\tmpg6y94cio\pip-20.1.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-20.1.1
D:\py project\DevTools>easy_install pip
WARNING: The easy_install command is deprecated and will be removed in a future version.
Searching for pip
Best match: pip 20.1.1
Adding pip 20.1.1 to easy-install.pth file
Installing pip-script.py script to d:\soft\python3.8\Scripts
Installing pip.exe script to d:\soft\python3.8\Scripts
Installing pip3-script.py script to d:\soft\python3.8\Scripts
Installing pip3.exe script to d:\soft\python3.8\Scripts
Installing pip3.8-script.py script to d:\soft\python3.8\Scripts
Installing pip3.8.exe script to d:\soft\python3.8\Scripts
--user
option or check the permissions.解决方法,pip命令换成pip3
或者在pip install 后面加上 --user + 需要安装的包名
D:\py project\DevTools>pip3 install PySide2
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting PySide2
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/81/73/830023aa8f06d9b04bf45146fd95f1a0f8644f196713fe98bc678e35ab6c/PySide2-5.15.
2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl (136.3 MB)
Collecting shiboken2==5.15.2
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/85/c2/49578ee1912e06e4f4ffb2cf974b4ee864f6d81bcb3961bc8b96de021cbd/shiboken2-5.1
5.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl (2.3 MB)
Installing collected packages: shiboken2, PySide2
Successfully installed PySide2-5.15.2 shiboken2-5.15.2
WARNING: You are using pip version 20.1.1; however, version 21.1.3 is available.
You should consider upgrading via the ‘d:\soft\python3.8\python.exe -m pip install --upgrade pip‘ command.
原文:https://www.cnblogs.com/xiehuangzhijia/p/14993488.html