如何通过pyinstaller将映像包含到.exe中

时间:2018-09-25 09:09:51

标签: python-3.x pyinstaller

我有一个简单的 test.py ,如下所示:

import pyautogui  
pyautogui.click(pyautogui.center(pyautogui.locateOnScreen(r'C:\Users\Lawrence\Desktop\PyTest\img.png')))

然后在CMD处键入以下命令:

pyinstaller.exe -F C:\Users\Lawrence\Desktop\test.py --windowed

它成功创建了一个 .exe 文件,但是如何将图像包含在 .exe 中?

我不想从绝对路径读取图像。我是Python的新手。谁能一步一步地告诉我如何实现?

预先感谢

劳伦斯

0 个答案:

没有答案
相关问题