Reputation: 6770
I have to generate an executable (.exe) file from my python program. I would like to store information in a persistent way within this .exe file itself.
Normally I would prickel it into an external file, however for me it is important that the information is stored in the .exe file itself and not externally.
Thanks in advance!
Upvotes: 1
Views: 630
Reputation: 47649
If you want read-write data:
Don't do this. An executable changing itself isn't guaranteed to work. Some executables write data at the end of the file (in theory) but you don't know:
[Nearly] all software is able to get by with 'normal' file storage (i.e. in a user / application data directory).
If you just want read-only data:
Fine, no problem. Write a Python file with the data in it, as a variable in a module. You can write a python file as part of your build process.
Upvotes: 1