save.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Imperialist-Bastards 作者: alabecki 项目源码 文件源码
def load_game(save_path):
    jsonpickle.set_preferred_backend('simplejson')

    #cur_path = os.path.dirname(__file__)
    #save_path = os.path.relpath('..\\Save Game\\' + file_name, cur_path)

    with open(save_path, 'r') as save:
        state = jsonpickle.decode(save.read(), keys = True)

    #print("State:")
    #for s in state:
    #   print(s)


    #save = shelve.open(file_name, writeback = False)
    #state = dict()
    #for k, v in save.items():
    #   state[k] = v
    #save.close()
    #save = shelve.open(file_name, flag = "n", writeback = False)

    return state
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号