2020-06-12から1日間の記事一覧
Pythonの辞書{}をファイルなどに永続化する方法は複数あります。 import json d = {'test':1} # jsonファイルとして保存 with open('json.json','w') as f: json.dump(d,f) # json stringとしてテキストファイルに保存 with open('json.txt','w') as f: txt …
Pythonの辞書{}をファイルなどに永続化する方法は複数あります。 import json d = {'test':1} # jsonファイルとして保存 with open('json.json','w') as f: json.dump(d,f) # json stringとしてテキストファイルに保存 with open('json.txt','w') as f: txt …