i know that pyinstaller --onefile filename.py converts python file to exe, but is it possible to pack additional jpg files to that exe? I mean, i have files like
main.py
image.jpg
image1.jpg
Can i convert it all into main.exe?
Sure, it is possible. See the doc here.
Basically, what you have to do is:
If running pyinstaller on your python script, run:
pyinstaller --add-data 'image.jpg:.' --add-data 'image1.jpg:.' main.py [Linux]
pyinstaller --add-data "image.jpg;." --add-data "image1.jpg;." main.py [Windows]
If running pyinstaller via a spec file, add to your spec file:
a = Analysis(...
datas=[ ('image.jpg', '.'), ('image1.jpg','.') ],
...
)
and run pyinstaller main.spec
Note that, quoting the doc:
The first string specifies the file or files as they are in this system now.
The second specifies the name of the folder to contain the files at run-time.