0
저는 파이썬에 관해서 매우 익숙합니다. python_diction
(더 큰 파일에 있음)이라는 내용을 가져와 python_diction_saved.json
이라는 새 파일에 저장하려고합니다. 나는 현재 내가 받고있는 오류를 아주 가깝게 느낀다. python_diction_saved.json
은 정의되지 않았다.사전에 파일 저장하기
도움을 주시면 감사하겠습니다.
import json
f = open("python_diction.txt","w")
python_diction = {}
python_diction["items"] = []
python_diction["items"].append({"hello":1,"hi":2})
python_diction["items"].append({"hello":42,"hi":65})
python_diction["numbers"] = [1,2,3,5,7,8]
f.write(json.dumps(python_diction_saved.json))
f.close()
'python_diction_saved' => 'python_diction' –
그레이트, 첫 번째 추적 오류를 해결했지만 지금은 또 다른 추적 오류가 발생했습니다 ...... f.write (json.dumps (python_diction_saved.json)) AttributeError : 'dict'객체에 'json'속성이 없습니다 – AvSmith
:'python_diction_saved.json' =>'python_diction' –