'pyinstaller 5.0.1 How to add updateable config.json to .exe (--onefile)

I am compiling a program into a single .exe where there is a config.json file. It contains settings that can change during the course of the program and must be saved so that the next time you run the .exe, the already changed settings from the config.json file are used.

Compiled as follows: pyinstaller -F --add-data "config.json;." main_worker.py

The program works, but changes in config.json are not saved (

I understand that when compiling into one .exe, all added data files are unloaded somewhere into temporary files and are deleted after the .exe is closed.

But is there any way to save the changes or overwrite the config.json file which is inside the .exe ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source