保存map信息到文件在python中的操作
提問人:楊紫紅發(fā)布時(shí)間:2020-11-19
>>> import pickle
v >>> game_data = {
'player-position' : 'N23 E45',
'pockets' : ['keys', 'pocket knife', 'polished stone'],
'backpack' : ['rope', 'hammer', 'apple'],
'money' : 158.50
}
w >>> save_file = open('save.dat', 'wb')
x >>> pickle.dump(game_data, save_file)
y >>> save_file.close()
繼續(xù)查找其他問題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>