def loadGame(self):
filename = QFileDialog().getOpenFileName(self, 'Load game')
if not filename[0]:
return
try:
with open(filename[0], 'rb') as handle:
config = pickle.load(handle)
except (pickle.UnpicklingError, FileNotFoundError, EOFError):
return
self.game = SinglePlayerGame()
try:
self.game.loadConfiguration(config)
except ValueError:
return
self.showGame()
评论列表
文章目录