teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

処理が重複していたのでコード修正

2017/04/20 07:10

投稿

8524ba23
8524ba23

スコア38352

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(json.dumps(hoge))
12
+ f.write(s)
13
13
 
14
14
  # jsonとして読込
15
15
  with open(filepath,'r') as f: