1
votes

I'm making onefile executables with pyinstaller on windows 10. I'm including data files (pickle files) by editing the .spec file...

How can I store changes made to these files during run time? My understanding is that the data files are copied to a temp directory during execution. I can read from the files using the path I get from sys._MEIPASS but the changes I write are lost after restarting the program.

Is there a way to write to pickle files stored inside the exe?

1
I'm just guessing here, but I'd say that doesn't work since it would require the machine that runs your exe to rebuild it after every execution. It'd probably be easier to bundle your script into one folder rather than one file. (Again: just taking a guess) - orangeInk
i understand that but i think there must be an easier way to do it - delex

1 Answers

0
votes

Do not mention the pickle file to pyinstaller and put the pickle file in the same folder than the bundled onefile. For me this works even if you have two files in the folder instead of one.