I am creating the exe of game made with pygame using pyinstaller. I am storing the highscore in a text file. The command is -
pyinstaller main.py --windowed --onefile --add-data "assets;assets"
The assets folder has the text file. Now the highscore functionality works fine for one session. But when I close the exe and open it again, the file resets to its original state.
Is there any way to prevent this?