为什么这会替换文件中已有的内容,我怎样才能得到它。(我应该只使用 .write .read 而不是 json 吗?)
def load():
with open("random_number_highscores.txt","r") as x:
print (json.load(x))
def save(a):
with open("random_number_highscores.txt", "w") as x:
json.dump(a, x)
print ("saved.")