Notice
Recent Posts
Recent Comments
250x250
Creative Code
Chapter14(json) 본문
728x90
import json
with open('study/json_example.json','r',encoding = 'utf8')as f:
contents = f.read()
json_data= json.loads(contents)
print(json_data['employees'])
dict_data = {'Name':'Zara','Age':7,'Class':'First'}
with open('study/data.json','w') as f:
json.dump(dict_data,f)
728x90
'코딩 study > python' 카테고리의 다른 글
페이지 정보 읽기 (0) | 2023.10.25 |
---|---|
url로 파일 다운받기 (0) | 2023.10.25 |
Chapter13(웹 스크래핑,다운로드) (0) | 2023.10.23 |
Chapter12(CSV,로그) (0) | 2023.10.23 |
Chapter11(예외처리,파일입출력) (0) | 2023.10.22 |