python  -m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py

2 资源文件转换

1) 创建qrc文件

<RCC>
<qresource prefix="pic">
<file>xxx/xxx.ico</file>
<file>xxx/xxx.jpg</file>
</qresource>
</RCC>

2) qrc 转py文件

pyrcc5 $FileName$ -o $FileNameWithoutExtension$.py

3) 代码中引用

import xxx.py

QtGui.Qpixmap(":/pic/xxx/xxx.png")

3 打包成exe

pyinstaller -F -w -i xxx.ico xxx.py

-F 表示打包单个文件;如果不打包成单个exe文件,则考虑用-D选项

-w 表示打包成图形界面,不带console

相关文章:

  • 2021-11-04
  • 2021-08-05
  • 2022-12-23
  • 2021-07-04
  • 2021-11-17
  • 2021-04-19
  • 2021-10-10
猜你喜欢
  • 2022-01-09
  • 2021-12-19
  • 2022-01-03
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案