我建议您搁置。例如:
import shelved = shelve.open('score.txt') # here you will save the score variable d['score'] = score # thats all, now it is saved on disk.d.close()下次打开程序时,请使用:
import shelved = shelve.open('score.txt')score = d['score'] # the score is read from diskd.close()它将从磁盘读取。如果需要,可以使用此技术保存分数列表。



