File wont save python

1 day ago 2
ARTICLE AD BOX

In my code pasted below, I try to save the new level status(what level the player is on) in stats.txt. When I read the text file after saving it in the code, the file has the correct value. But when I click the x to close the program, the file reverts back to before I ran it. If I force close the program with an error or raise SystemExit, the file saves properly. What do I do?

asked 35 secs ago

Grant Stapley's user avatar

New contributor

Grant Stapley is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Read Entire Article