https://www.python.org/ftp/python/3.7.0/python-3.7.0-amd64.exe
https://download.jetbrains.8686c.com/python/pycharm-professional-2018.1.4.exe
D:\Python\Python37\Scripts\pip3.exe install sip
D:\Python\Python37\Scripts\pip3.exe install PyQt5
D:\Python\Python37\Scripts\pip3.exe install PyQt5-tools
离线
下载并安装python3.7版本:
安装python软件包:
D:\Python\Python37\Scripts\pip3.exe install sip
D:\Python\Python37\Scripts\pip3.exe install PyQt5
D:\Python\Python37\Scripts\pip3.exe install PyQt5-tools
打开 Qt Designer, 随便设计一个窗体:
根据 *.ui 生成 *.py 文件:
D:\Python\Python37\python.exe -m PyQt5.uic.pyuic test.ui -o test2.py
test2.py 最末添加:
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
if __name__ == '__main__':
app = QApplication(sys.argv)
MainWindow = QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
在命令行运行:
D:\Python\Python37\python.exe F:\pywin\test2.py
完美:
源码下载: pywin_src.7z
离线