The last post in that thread told you how to write to the file without first deleting its contents.
Ancient Dragon
Achieved Level 70
32,116 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69
The last post was from someone named Brian Muth, and suggested opening the file with "rb+", which is what you want to do.
Ancient Dragon
Achieved Level 70
32,116 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69