I am try to make it possible to save progress in my python game put the following line is giving me problems:
dataW = open("data.dat","wb")
How can I stop this line from clearing my file.
I am try to make it possible to save progress in my python game put the following line is giving me problems:
dataW = open("data.dat","wb")
How can I stop this line from clearing my file.
You're opening the file in write mode:
'w'
for only writing (an existing file with the same name will be erased)
Emphasis mine
You meant to use the append mode:
'a'
opens the file for appending