Pyinstaller包含文件夹

时间:2018-09-27 13:57:45

标签: python-3.x pyinstaller

我有以下目录,我希望它们包含在我的.exe中

ProjectFolder
|---Python
|   |---App.py
|   |---data
|       |---pic.png
|       |---batch
|           |---batchscript1.bat
|           |---batchscript2.bat
|---App.exe
|---App.spec
|---Pyinstaller.exe

并且我使用了以下批处理脚本

pyinstaller ^
       --clean ^
       --onefile --noconsole ^
       --add-data="%~d0%~p0Python\data;." ^
       --distpath ./ ^
       "%~d0%~p0Python\App.py"

但是当我打开App.exe时,没有图片显示。我认为它们在exe文件中会丢失。

我包括这样的self.setWindowIcon(QIcon('data\pic.png') )

如何在我的exe中正确包含data文件夹?

0 个答案:

没有答案