【发布时间】:2021-05-30 12:17:32
【问题描述】:
导入pygame,随机
定义相当游戏():
readFile = open("BestScore.txt")
bestScoreFile = readFile.read()
readFile.close()
writeFile = open("BestScore.txt")
iScore = max(score,int(bestScoreFile))
print('Your Score is :', score)
print('Highest Score is :', iScore)
writeFile.write(str(iScore))
writeFile.close()
pygame.quit()
为什么会有消息“ writeFile.write(str(iScore)) io.UnsupportedOperation: not writable" 显示在那里。
【问题讨论】: