回答編集履歴
1
処理が重複していたのでコード修正
answer
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
filepath = 'json.txt'
|
10
10
|
with open(filepath,'w') as f:
|
11
11
|
s = json.dumps(hoge) # オブジェクトをjson形式の文字列に
|
12
|
-
f.write(
|
12
|
+
f.write(s)
|
13
13
|
|
14
14
|
# jsonとして読込
|
15
15
|
with open(filepath,'r') as f:
|